I want to that my petition site should run like http://www.petitionspot.com rather then http://petitionspot.com irrespective of what the user have type it should get redirected to the www domain. how can i do that with .htaccess file
RewriteEngine On Options FollowSymLinks RewriteBase / # Rewrites non-www to www. RewriteCond %{HTTP_HOST} !^www\..* RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} ^([^.]*)\.(com|co\.uk) RewriteRule ^.*$ http://www.%1.%2%{REQUEST_URI} [R=permanent,L] Code (markup):
I would like the same thing, except the other way around. I want www to go to http:// What would my .htaccess look like? Thanks. ~YC
To the 'www': Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} !^(www\.|$) [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Code (markup): To go from the 'www' to non 'www' use this code: Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST}//s%{HTTPS} ^www\.(.*)//((s)on|s.*)$ [NC] RewriteRule ^ http%3://%1%{REQUEST_URI} [L,R=301] Code (markup):