Hello,
I decided to change all urls with /product/ (to suite my language). Added .htaccess rules, and now works fine: all product urls have the new permalink structure, and sitemap too. But how to redirect 301 all old urls? I tried
Redirect 301 /product/ http://www.mysite.com/pricetapestry/product_new_folder/
but does not work.
And I decide to change /category/ permalink structure, I presume the only file to change is categories.php . How to modify=
Thank you as usual!
Thanks, work fine.
Another question: I have to redirect all searches from old folder. Which is the htaccess instructions to redirect all
site.com/old_folder/search.php?q=
to
site.com/new_folder/search.php?q=
? Thanks in advance
Hi,
Have a go with;
RewriteRule ^old_folder/search.php?q=(.*)$ new_folder/search.php?q=$1 [L,R=301]
Cheers,
David.
before or after the line
RewriteEngine On
RewriteBase /oldfolder/
?
Hi,
If the rule is going in .htaccess in /oldfolder/, then you'll actually need to use the following instead, after the RewriteBase line...
RewriteRule ^search.php?q=(.*)$ /new_folder/search.php?q=$1 [L,R=301]
Hope this helps!
Cheers,
David.
Hi,
I would use (towards the top of your .htaccess after RewriteBase)
RewriteRule ^product/(.*)$ product_new_folder/$1 [L,R=301]
(same for categories if you wish to do a redirect). To change the links, you won't actually need to change categories.php at all as category/ does not appear in there (if using rewrite it assumes that folder already), so after modifying .htaccess to use your new virtual folder name, simply update any existing links you have to category/ (in the distribution it is just the Browse by... link in index.php) and that should be all you need to do...
Cheers,
David.