• Resolved akashmughal21

    (@akashmughal21)


    Hi,

    I am trying to redirect any URL that contains a certain query string (?login=failed) to a specific page (/login-failed/).

    I am using the below code in the .htacess file but it is not working for me.

    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteCond %{QUERY_STRING} login=failed
    	RewriteRule (.*) /login-failed/ [R=301,L]
    </IfModule>

    Is there anyone who can highlight the mistake or guide me on how I can do it.
    P.S: “I am not a developer or familiar with javascript or PHP languages.”

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    RewriteRule (.*) /login-failed/? [R=301,L]
    (add ? to the URL or else the old query string gets appended, causing an infinite loop)

Viewing 1 replies (of 1 total)
  • The topic ‘Query String Redirect’ is closed to new replies.