Need help with rewrite rule

Im trying to redirect all mydomain.com to www.mydomain.com to avoid SEO double indexing issues. Here is the code in my .htaccess file. Can anyone tell me where Im going wrong?



if I try to enter in the rewriterule my page will not load no matter what url I try.


RewriteEngine On<br />
RewriteCond %{HTTP_HOST} !^www\.thinkoutsidetheshowroom\.com [NC]<br />
RewriteRule ^(.*)$ http://www.thinkoutsidetheshowroom.com/$1 [L,R=301]<br />
RewriteRule ^$ http://www.thinkoutsidetheshowroom.com/index.php [L,R=301]<br />
DirectoryIndex index.html index.php<br />
<IfModule mod_rewrite.c><br />
RewriteEngine on<br />
# Some hostings require RewriteBase to be uncommented<br />
# Example:<br />
# Your store url is http://www.yourcompany.com/store/cart<br />
# So "RewriteBase" should be:<br />
# RewriteBase /store/cart <br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . index.php?sef_rewrite=1 [L,QSA]<br />
<br />
RewriteCond %{REQUEST_FILENAME} .*\/catalog\/.*<br />
RewriteCond %{REQUEST_FILENAME} -d<br />
RewriteCond %{REQUEST_FILENAME}/index.html !-f<br />
RewriteRule . index.php?sef_rewrite=1 [L,QSA]<br />
<br />
</IfModule>

Anyone have an idea?

Here’s what I do:




RewriteCond %{HTTP_HOST} ^inkwow\.com [NC]
RewriteRule ^(.*)$ http://www.inkwow.com/$1 [L,R=301]


RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]

Thanks, I found the issue.



In my config.local.php file it was set for mydomain.com so even though redirect would send to www.mydomain.com the config.local.php would send back to mydomain.com



One big loop :grin: