daknetworks.com

You are here: Blog Redirect Entire Domain

Redirect Entire Domain

Of course you can use the DNS at the REGISTRAR (GoDaddy, Enom, etc) level but what if you have access to the server but not the domain?

Two files are needed:

  1. index.php
  2. .htaccess (don't forget the leading '.' and there are no extensions)

The contents of the index.php file to redirect to the new web site:

<?php
    header('Location: https://foo.tld');
?>

The contents of the .htacess file to redirect any phantom links to the index page:

Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Contact Dak Networks

We are not taking on new clients at this time.