tohe
tohe

Reputation: 43

How to redirect 301 bad url?

I have bad url:

http://mypage.org/first/second/?one=two&three=3&44=1

and i want this redirect to:

http://mypage.org

but in htaccess:

Redirect 301 /first/second/?one=two&three=3&44=1 http://mypage.org

not working. For example:

Redirect 301 /first/second http://mypage.org

working ok.

Upvotes: 4

Views: 96

Answers (1)

Justin Iurman
Justin Iurman

Reputation: 19026

You can check query string with mod_rewrite

RewriteEngine On

RewriteCond %{QUERY_STRING} ^one=two&three=3&44=1$ [NC]
RewriteRule ^first/second/$ /? [R=301,L]

Upvotes: 2

Related Questions