Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Redirect www.example.com to example.com
Old 07-02-2010, 05:37 AM Redirect www.example.com to example.com
Novice Talker

Posts: 14
Name: Luke
Trades: 0
Here is the code for a redirect. Substitute your own domain.

non-www to www:


Code:
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*) http://www.example.com/$1 [R,L]

Recommended
www to non-www:

Code:
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Just upload either one of these to the bottom of your .htaccess file.

Save either of these as a .htaccess file. It is important to redirect one of these to the other otherwise search engines will treat your one big site as two small sites.
Enarcade is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Redirect www.example.com to example.com
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09381 seconds with 12 queries