I have a old url :
http://www.abc.com/search.php?id=12&name=amit
After some time i have made the changes(for proper url rewriting) in url and it became
http://www.abc.com/search.php?name=amit&id=12
The url rewriting of new url(changed url) is successfully done to
But the problem is, How I redirect 301 from old url (through htaccess)
http://www.abc.com/search.php?id=12&name=amit
to
new url
I have tried a lots but m unsuccessful..What should I do ? Help.. Anybody!
Thanks !
You can use this rule:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+search\.php\?id=([^&]*)&name=([^\s&]+) [NC]
RewriteRule ^ /%2-%1? [R=301,L]
Make sure to insert this rule before all other rules .
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.