Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

Problems with www to non-www htaccess redirect
(1 viewing) (1) Guest
Magento E-Commerce accelerator component.
  • Page:
  • 1

TOPIC: Problems with www to non-www htaccess redirect

Problems with www to non-www htaccess redirect 13 years, 10 months ago #20291

Hi,

After I have installed M-Turbo, there is a problem with the www to non-www htaccess redirect.
Usually I have this code in my htaccess

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

.. but after I M-Turbo is activated, www.domain.com redirects to

domain.com/var/turbocache/default.html

instead of

domain.com

- which is of course not good. What can I do to fix this?
The topic has been locked.

Re: Problems with www to non-www htaccess redirect 13 years, 10 months ago #20321

I found the solution.

Its important you put the lines as the FIRST thing after the mod_rewrite module is loaded.
If you put it after, it will not work.


<IfModule mod_rewrite.c>

############################################
## redirect www to non-www
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteRule ^(.*)$ domain.com/$1 [L,R=301]
Last Edit: 13 years, 10 months ago by Wickings.
The topic has been locked.
  • Page:
  • 1
Moderators: pedu
Přihlášení uživatele Prázdný