"no www" -> "www" Redirect 301 problem
Posted: Fri Aug 12, 2011 2:57 pm
Hi.
I'am trying to do a "no www" to "www" 301 redirect into CMSMS .htaccess...
eg.:
http://mysite.com -> http://www.mysite.com
http://mysite.com/contact -> http://www.mysite.com/contact
I was trying to put:
into the CMSMS .htaccess, but its not working.
My page works fine, and I have 'mod_rewrite' turned on in config.php
I was fighting with it for over 5 hours, and I didn't found solution...
Help me please!
My .htaccess:
Thank you, and sorry for english.
I'am trying to do a "no www" to "www" 301 redirect into CMSMS .htaccess...
eg.:
http://mysite.com -> http://www.mysite.com
http://mysite.com/contact -> http://www.mysite.com/contact
I was trying to put:
Code: Select all
rewritecond %{http_host} ^mysite.com [nc]
rewriterule ^(.*)$ http://www.mysite.com/$1 [r=301,nc]
My page works fine, and I have 'mod_rewrite' turned on in config.php
I was fighting with it for over 5 hours, and I didn't found solution...
Help me please!
My .htaccess:
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Thank you, and sorry for english.