Return to Snippet

Revision: 6302
at May 15, 2008 05:46 by catchamonkey

Initial Code
In your Virtual Host declaration add a ServerAlias under your ServerName declaration for example you would have


This on it's own would mean that visitors will be sent to your site with or without the www. prefix.

What we can do is take the url they entered for example
and rewrite it to

All you need to do is; within your .htaccess file for the site add the following at the top

RewriteCond %{HTTP_HOST} ^domain\
RewriteRule ^(.*)$$1 [R=301,L]

Initial URL

Initial Description
Rewrite your urls for to including full url

Initial Title
301 Rewrite to like the search engine friendly developer you are!

Initial Tags

Initial Language