ok i'm trying to redirect my domain http://iphonewifihotspots.info to this: www.iphonewifihotspots.info (so includes the WWW) I tried this: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.iphonewifihotspots\.info [NC] RewriteRule ^(.*) http://www.iphonewifihotspots.info/$1 [L,R=301] But it doesn't work. It justs go to this: http://www.iphonewifihotspots.info/iphonewifihotspots/ (it has a forward slash after it and some more text. and it is 404 page not found) I've also tried this: RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.iphonewifihotspots\.info$ [NC] RewriteRule ^(.*)$ http://iphonewifihotspots.info/$1 [R=301,L] But it still doesn't work. it goes to this: http://www.iphonewifihotspots.info/iphonewifihotspots/ (which goes to 404 page not found) What is wrong? I'm hosted with hostgator on a shared server.
Those codes look more like you're trying to get rid of the www!!! RewriteEngine on RewriteCond %{HTTP_HOST} ^iphonewifihotspots\.info [NC] RewriteRule ^(.*)$ http://www.iphonewifihotspots.info/$1 [R=301,L]
RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.iphonewifihotspots\.info [NC] RewriteRule (.*) http://www.oiphonewifihotspots.info/$1 [R=301,L]
i've solved my problem. i was modifying the htaccess from my public html folder when i should have been modifying the htaccess in my subdomain folder.