|
|
Joined: Jun 2006
Posts: 16,369 Likes: 126
|
Joined: Jun 2006
Posts: 16,369 Likes: 126 |
This is quite simple to do in Apache with your .htaccess file (if you don't have a .htaccess file in your web root, you can add one). The following is what I use on my site to accomplish this: # Allow Re-Writing
RewriteEngine on
# Redirect non-www URLs to WWW
RewriteCond %{HTTP_HOST} ^corthell.net$
RewriteRule ^(.*) http://www.corthell.net/$1 [QSA,L,R=301]
Simply replace "corthell.net" with your domain on the two lines that it's mentioned, insert into your .htaccess file, and upload to your server.
|
|
|
|
Joined: Jun 2006
Posts: 16,369 Likes: 126
|
Joined: Jun 2006
Posts: 16,369 Likes: 126 |
Due to the non-www stance some users use, I'm also going to describe how to send all www requests to the non-www domain... Be sure that you're not using both of these as you could cause a lot of looping on your webserver. The instructions above are still valid, however, use this .htaccess block. # Allow Re-Writing
RewriteEngine on
# Redirect WWW URLs to non-www
RewriteCond %{HTTP_HOST} ^www.corthell.net$
RewriteRule ^(.*) http://corthell.net/$1 [QSA,L,R=301]
Last edited by Gizmo; 08/03/2011 1:35 AM.
|
|
|
3 members (Ruben, SenecaFlyer, 1 invisible),
1,719
guests, and
157
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|
|