Display Name Display Name - 6 months ago 18x
PHP Question

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

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



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?


Add the following rule above your existing rules :

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

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