开发者

Set htaccess redirect based on query string

开发者 https://www.devze.com 2023-02-19 16:05 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消