• Hi guys!

    I’ve moved my wordpress website from a domain to another, and I’ve created some 301 redirect to move my users from old to new pages.

    I’ve created a redirect for wp-login.php page (because of my users), but I need it to check some contents. Can I create some exeptions for me?

    Thank you

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Not by using the RedirectMatch directive, if that is what you are using. But you can by using RewriteCond and RewriteRule. Then you can specify that the rewrite only occur for requests NOT from your IP. For example:

    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteBase /
    	# !!! Enter Current IP address for admin access !!!
    	RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123
    	RewriteCond %{REQUEST_URI} ^wp-login.php	 [NC]
    	RewriteRule . https://new-domain.com/wp-login.php [R=301,L]
    </IfModule>

    Untested. Keep a backup ready at hand in case there’s a typo that crashes your site. Determine what your actual IP address is and use it in place of the one shown, but maintain the format shown with additional !^\ chars. This basically says “if the request is for wp-login.php AND the IP is NOT mine, redirect to the new domain.”

    Assuming you have not redirected /wp-admin/ and /uploads/ requests and only redirected front end requests, this should be enough to get you into the back end. If you redirected /wp-admin/ and/or /uploads/ as well, you’ll need a similar rule set for those paths.

Viewing 1 replies (of 1 total)
  • The topic ‘duplicate login page’ is closed to new replies.