Jump to content

[Solved] 301 redirect


Recommended Posts

Hi,

I would like to make a forward from domain.com -> www.domain.com (including all subdirectories).
My prestashop installation is located in a folder called shop, I have the .ht access file here, but there is none in my root folder. I tried creating a .htaccess file in my root folder with the following content

RewriteEngine on
RewriteCond %{HTTP_HOST} ^super-food.dk
RewriteRule (.*) http://www.super-food.dk/$1 [R=301,L]



and it does forward from domain.com -> www.domain.com, but not for for instance domain.com/shop/product.php -> www.domain.com/shop/product.php

Does anybody have any input on how I could get alle the subdirectories/pages to redirect correctly as well.

Link to comment
Share on other sites

Thanks Rocky, It was solved by doing the following
In root folder .htaccess

RewriteCond %{http_host} ^domain.com [nc]
RewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,nc]



In shop folder:

RewriteCond %{http_host} ^domain.com [nc]
RewriteRule ^(.*)$ http://www.domain.com/shop/$1 [r=301,nc]

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...