It's easy. We already do this.
Step 1:
Set up a .htaccess with the following:
Code:
ErrorDocument 404 /index.php
(you can add 400, 401, 402, 403... if you will be forwarding all traffic)
Step 2:
Create a file called index.php with the following php code:
Code:
header('Location: http://www.sedo.co.uk/parking/'.$_SERVER["HTTP_HOST"]); That's it.
If you're concerned about catching traffic to *.domain.com (not just www. and domain.com), you'll need a function to rewrite your HTTP_HOST variable. I can supply such a function, but coding is our primary business, so I'm not in the habit of giving out code for free.
Bookmarks