jeyjoo Posted January 4, 2013 Share Posted January 4, 2013 Hi, I am trying to direct all non-www requests to www on the website varaldocosmetica, but it is not working. The code I am using is: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.varaldocosmetica\.it [NC] RewriteRule ^(.*)$ http://www.varaldocosmetica.it/$1 [R=301,NC,L] Any ideas, Thanks Link to comment Share on other sites More sharing options...
sunilmkt Posted January 4, 2013 Share Posted January 4, 2013 You want to redirect non-www url to www url version. I think you should try this code RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com RewriteRule (.*) http://www.example.com/$1 [R=301,L] Replace example.com with your own website name. Link to comment Share on other sites More sharing options...
El Patron Posted January 5, 2013 Share Posted January 5, 2013 or you can use this and not worry about your actual url name. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </IfModule> Link to comment Share on other sites More sharing options...
jeyjoo Posted January 5, 2013 Author Share Posted January 5, 2013 I have tried both of these methods but neither work in explorer and chrome ( I also cleared smarty cache and browser). Link to comment Share on other sites More sharing options...
El Patron Posted January 5, 2013 Share Posted January 5, 2013 I have tried both of these methods but neither work in explorer and chrome ( I also cleared smarty cache and browser). your website (checked yesterday and today) redirects to the www. did you clear you browser cache and cookies? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now