How to exclude wordpress login register pages from this rewrite rule

I am using wordpress for my website.in root directory
to remove query string from wesites url

I am using this code

Read More
RewriteCond %{QUERY_STRING} .
RewriteRule ^$ /? [R=301,L]

RewriteCond %{THE_REQUEST} ?
RewriteCond %{QUERY_STRING} .+
RewriteRule .? %{REQUEST_URI}? [R=301,L]

RewriteCond %{THE_REQUEST} ^(GET|HEAD|POST) /[^ ?]*?($| )
RewriteRule ^(.*)$ /$1? [L,R=301]

but now problem is that

wp-login.php?action=lostpassword

wp-login.php?action=register

this urls also redirecting to parent url

I tried excude wp-login.php file from this rule but didn work.

How to solve this issue?

Related posts

1 comment

  1. Add the following rule above your existing rules :

    RewriteRule ^wp-login.php$ - [L]
    

    This tells the engine to pass /wp-login.php without rewriting.

Comments are closed.