Chris2000 Posted March 23, 2010 Share Posted March 23, 2010 Hello, I moved my store from root to /catalog -without almost any issues. Except I can't seem to get the right .htaccess code to redirect categories. And any help would be appreciated. ie: index.php?cPath=43 to redirect to catalog/index.php?cPath=43 or even better all categories to redirect to their new addresses. index.php?cPath= to redirect to catalog/index.php?cPath= I've tried (in the root .htaccess)to no success. RewriteEngine on RewriteCond %{QUERY_STRING} ^cPath=43$ RewriteRule ^/index.php?$ http://www.mywebsite.com/catalog/index.php?cPath=43 [L,R=301] RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{QUERY_STRING} ^cPath=43$ RewriteRule ^/index.php?$ http://www.mywebsite.com/catalog/index.php?cPath=43 [L,R=301] Will someone please help me with the correct code? Thank you, Chris Link to comment Share on other sites More sharing options...
johnnybebad Posted March 24, 2010 Share Posted March 24, 2010 Hello, I moved my store from root to /catalog -without almost any issues. Except I can't seem to get the right .htaccess code to redirect categories. And any help would be appreciated. ie: index.php?cPath=43 to redirect to catalog/index.php?cPath=43 or even better all categories to redirect to their new addresses. index.php?cPath= to redirect to catalog/index.php?cPath= I've tried (in the root .htaccess)to no success. RewriteEngine on RewriteCond %{QUERY_STRING} ^cPath=43$ RewriteRule ^/index.php?$ http://www.mywebsite.com/catalog/index.php?cPath=43 [L,R=301] RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{QUERY_STRING} ^cPath=43$ RewriteRule ^/index.php?$ http://www.mywebsite.com/catalog/index.php?cPath=43 [L,R=301] Will someone please help me with the correct code? Thank you, Chris you keep everything the same as before and add at the start:- RewriteBase /catalog/ Getting better with mods but no programmer am I. Link to comment Share on other sites More sharing options...
Chris2000 Posted March 25, 2010 Author Share Posted March 25, 2010 you keep everything the same as before and add at the start:- RewriteBase /catalog/ Thanks for the help Johnny. But that didn't work for me. Although I found the issue - apache doesn't like '/' so on the RewriteRule I added a '?'to '/?' which tells apache use or not (I guess). This Works: RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{QUERY_STRING} ^cPath=50$ RewriteRule ^/?index.php?$ http://www.yourwebsite.com/catalog/index.php?cPath=50? [L,R=301] This is what I had - that didn't work: Notice the lack of a '?' after '/' in the RewriteRule RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{QUERY_STRING} ^cPath=50$ RewriteRule ^/index.php?$ http://www.yourwebsite.com/catalog/index.php?cPath=50? [L,R=301] Issue Solved! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.