It behooves you to make sure you’ve only got one URL that serves a given piece of content–so says google. But what if you’ve got a bunch of domains that go to your page?
For this blog, for example, matthew.mceachen.org, and mrm.mceachen.org all go to the same place. That was done with an apache redirect in /etc/apache2/sites-enabled/matthew:
|
1 2 3 4 5 |
<VirtualHost *:80> ServerName matthew.mceachen.org ServerAlias www.matthew.mceachen.us mrm.mceachen.org Redirect permanent / http://matthew.mceachen.us/ </VirtualHost> |
If you want to redirect from one directory to another, PHP makes that pretty simple. This is the contents of my ~/public_html/index.php that directs people into my blog:
|
1 2 3 |
<?php header('Location: http://matthew.mceachen.us/blog/'); ?> |