Reputation: 57
I was in the need of migrating my site to a subfolder, it is a php script, its links are like this :
aff_link.php?id=812 (number changes at the end) and html files like gifts.html rss_feeds.html and others ending in .html
I need to redirect those two kind of links to a subfolder called "old"
any advice on this? Thank you in advance.
Upvotes: 1
Views: 24
Reputation: 785196
You can use this rule in site root .htaccess:
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)q=id=\d+ [NC]
RewriteRule ^aff_link\.php$ /old/$0 [L,NC,R=301,NE]
Upvotes: 2