Set htaccess redirect based on query string
I want to redirect old pages like this:
http://www.agriturismoborgobiaia.it/index.ph开发者_运维技巧p?option=com_content&view=article&id=47&Itemid=54&lang=en
to
http://www.agriturismoborgobiaia.it/
Only if query string contains certains value.
How can I do that?
So you have to use mod_rewrite of apache (or whatever your engine is)
RewriteEngine On
RewriteCond %{QUERY_STRING} <a regex here>
RewriteRule ^.*$ http://www.agriturismoborgobiaia.it/ [R,L]
Look at Clean URL, Rewriting Guide and mod_rewrite documentation as references :
In your .htaccess
Redirect 301 oldpage newpage
精彩评论