I am using Miva 9.00052 with URI management and want to redirect non-www to www . Previously I have done this by added a rewrite line in my .htaccess file. Will this method still work? If so, should the code be added before or after the Miva URI rewrite rules?
Announcement
Collapse
No announcement yet.
Redirect non-www to www with new URI Management or .htaccess?
Collapse
X
-
Redirect non-www to www with new URI Management or .htaccess?
Highly caffeinated
http://www.coffeehouseexpress.comTags: None
-
That will still work and should be the first thing in the file so the subsequent request that is analyzed for short links, etc. is already using the hostname you want it to be on:
Code:RewriteEngine On RewriteCond %{HTTP_HOST} !^www.coffeehouseexpress.com$ [NC] RewriteRule ^(.*)$ http://www.coffeehouseexpress.com/$1 [R=301,L]
Last edited by ILoveHostasaurus; 01-19-16, 11:39 AM.
- 1 like
-
Same procedure and add it just under this line:
RewriteEngine on
Andreas Toman
PCINET, LLC
Miva Merchant Design, Development, Integration & Support
We built over 200 Miva Merchant stores!
Miva shopping cart design & integration service and see our Portfolio!
e-mail: [email protected]
web: www.pcinet.com
LinkedIn: Andreas Toman
phone: (786) 250-2056 (Miami, FL)
Comment
-
Originally posted by ILoveHostasaurus View PostThat will still work and should be the first thing in the file so the subsequent request that is analyzed for short links, etc. is already using the hostname you want it to be on:
Code:RewriteEngine On RewriteCond %{HTTP_HOST} !^www.coffeehouseexpress.com$ [NC] RewriteRule ^(.*)$ http://www.coffeehouseexpress.com/$1 [R=301,L]
Thanks for the replies... I am getting an error when using the code above : ERR_TOO_MANY_REDIRECTSHighly caffeinated
http://www.coffeehouseexpress.com
Comment
-
Try this:
RewriteCond %{http_host} ^coffeehouseexpress.com [NC]
RewriteRule ^(.*)$ http://www.coffeehouseexpress.com/$1 [R=301,L]Andreas Toman
PCINET, LLC
Miva Merchant Design, Development, Integration & Support
We built over 200 Miva Merchant stores!
Miva shopping cart design & integration service and see our Portfolio!
e-mail: [email protected]
web: www.pcinet.com
LinkedIn: Andreas Toman
phone: (786) 250-2056 (Miami, FL)
- 1 like
Comment
-
Originally posted by PCINET - Andreas View PostTry this:
RewriteCond %{http_host} ^coffeehouseexpress.com [NC]
RewriteRule ^(.*)$ http://www.coffeehouseexpress.com/$1 [R=301,L]
Thanks Andreas! That did it, seems to work fine!Highly caffeinated
http://www.coffeehouseexpress.com
Comment
-
Originally posted by ILoveHostasaurus View PostThat will still work and should be the first thing in the file so the subsequent request that is analyzed for short links, etc. is already using the hostname you want it to be on:
Code:RewriteEngine On RewriteCond %{HTTP_HOST} !^www.coffeehouseexpress.com$ [NC] RewriteRule ^(.*)$ http://www.coffeehouseexpress.com/$1 [R=301,L]
I'm sorry ILoveHostasaurus , your code does work too ! I did not have the "www" in the RewriteCond.Highly caffeinated
http://www.coffeehouseexpress.com
Comment
Comment