Please Help me in htaccess file mod_rewrite + redirect This is my .htaccess file and working fine. What I want If any one try to browse the site without www , this have the capability to redirect the url with www. Example:- if someone try to browse with http://mydomain.com/theater/city/123 then this will be redirect to http://www.mydomain.com/theater/city/123 My current .htaccess file below. Code: Options +FollowSymLinks Options -MultiViews RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteRule \.(gif|jpg)$ - [F] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^city/(.*)/(.*)$ index.php?city=$1&page=$2 RewriteCond %{QUERY_STRING} !page RewriteRule ^city/(.*)$ index.php?city=$1 [L] RewriteRule ^cinemas/(.*)/(.*)/(.*)$ theater.php?thid=$3&cityname=$1 [L] RewriteRule ^cinemas-new/(.*)/(.*)/(.*)$ theater-new.php?thid=$3&cityname=$1 [L] RewriteRule ^sitemap.xml(.*)$ sitemap.php [L] Code (markup): Thanks in advance I really require this.
This code should work for you RewriteBase / RewriteCond %{HTTP_HOST} ^abc.com [NC] RewriteRule ^(.*)$ http://www.abc/$1 [L,R=301] Code (markup):