martinc Posted October 21, 2010 Share Posted October 21, 2010 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.phpDoes 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 More sharing options...
rocky Posted October 22, 2010 Share Posted October 22, 2010 You're missing a ^ and $ in the rewrite rule. Try the following: RewriteCond %{http_host} ^super-food.dk [nc] RewriteRule ^(.*)$ http://www.super-food.dk/$1 [r=301,nc] Link to comment Share on other sites More sharing options...
martinc Posted October 23, 2010 Author Share Posted October 23, 2010 Thanks Rocky, It was solved by doing the followingIn 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 More sharing options...
prestarou Posted March 9, 2011 Share Posted March 9, 2011 i don/t understand what mean "in shop folder" where do put the code. Rocky if i mody just what you write it doesn't work Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now