Hi, I liked to redirect my non www. urls of my homepage to the www. urls
Ex http://nihonomaru.com/ should redirect to
http://www.nihonomaru.com/
However, when i applied this rule to the .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
It is working but now on my forum, where i host my images on lightspeed, img1 subdomain, the images aren't appearing because they also get redirected i.e., img1 gets redirected to
www.img1
See
http://img1.nihonomaru.com/lighttpd/...edals/1231.gif
How can i apply an exclusion rule so the redirect doesn't not affect sub-domains? Or for only to apply the redirect for the homepage pages only?
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/forum/(.*)
RewriteCond %{REQUEST_URI} !^/img1/(.*)
RewriteCond %{REQUEST_URI} !^/cache/(.*)
RewriteCond %{REQUEST_URI} !^/lighttpd/(.*)
RewriteCond %{REQUEST_URI} !^forum\.nihonomaru\.com
RewriteCond %{REQUEST_URI} !^img1\.nihonomaru\.com
RewriteCond %{REQUEST_URI} ^/chan.*
RewriteRule (.*) - [L]
RewriteCond %{REQUEST_URI} "/lighttpd/"
RewriteRule (.*) $1 [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{REQUEST_URI} !^img1\.nihonomaru\.com
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
RewriteRule ^$ public/ [L]
RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
RewriteRule (.*) public/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>