Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Moving store from root to /catalog


Chris2000

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...