I used RewriteRule
for 301 redirect in Apache server - all URLS working except these two:
RewriteCond %{QUERY_STRING} recordID=3
RewriteRule ^articles.details\.php$ /festivals-religious/? [L,R=301]
RewriteCond %{QUERY_STRING} recordID=39
RewriteRule ^articles.details\.php$ /festivals-traditional/? [L,R=301]
Both URLs redirected to: /festivals-religious/.
I think conflict with recordID=3
and recoredID=39
, as 3 exists in both URLs.
The problem is that the second RewriteCond
also matches the first one. One option would be to add a $
to the end of the first rule, like so:
RewriteCond %{QUERY_STRING} recordID=(3)$
RewriteRule ^articles.details.php$ /festivals-religious/? [L,R=301]
RewriteCond %{QUERY_STRING} recordID=39
RewriteRule ^articles.details.php$ /festivals-traditional/? [L,R=301]
The $
means "the end of this particular query string."
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.