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.


```php RewriteEngine On

RewriteCond %{HTTP_HOST} !^www.thinkoutsidetheshowroom.com [NC]

RewriteRule ^(.*)$ http://www.thinkoutsidetheshowroom.com/$1 [L,R=301]

RewriteRule ^$ http://www.thinkoutsidetheshowroom.com/index.php [L,R=301]

DirectoryIndex index.html index.php



RewriteEngine on

Some hostings require RewriteBase to be uncommented

Example:

Your store url is http://www.yourcompany.com/store/cart

So “RewriteBase” should be:

RewriteBase /store/cart

RewriteBase /

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]



RewriteCond %{REQUEST_FILENAME} ./catalog/.

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_FILENAME}/index.html !-f

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



```

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: