I need to do a 301 permanent redirect from
http://www.example.com/search.php?search=samplesearch
to
http://www.example.com/used/search.php?search=samplesearch [301]
Any help greatly appreciated. Thanks
I think you'll find your answer if you search stackoverflow for ' redirect htaccess 301 '. If you want to see how it's done. Use your cPanel to create a permanent redirect and then open your htaccess file with a text editor or cpanel filemanager to view the code. Then you'll know how to mod the htaccess manually if you need to.
Use RewriteCond with %{THE_REQUEST}
RewriteEngine on
RewriteCond %{THE_REQUEST} ^GET \/search\.php\?search=samplesearch\ HTTP/ [NC]
RewriteRule ^(.*)$ /used/search.php?search=samplesearch [R=301,L]
For more information about mod_rewrite variables this site may help you: http://www.askapache.com/tools/mod_rewrite-variables-cheatsheet.html
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.