Last active
July 20, 2017 18:50
-
-
Save facelordgists/27923b1b699036bd5b01348b939187ff to your computer and use it in GitHub Desktop.
Redirect WordPress admin to temp page. Useful for migrating /migrate / migrations of WP installs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add these lines to your .htaccess file and upload migrating.html alongside it | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR] | |
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin/(.*)$ | |
#RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123$ #Add your IP address here if you want to whitelist it | |
RewriteRule ^(.*)$ /migrating.html [R=301,L] | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Migration in progress</title> | |
</head> | |
<body> | |
<h1> Migration in progress</h1> | |
<p>This site is currently undergoing migration to another server, and cannot be edited until migration is complete.</p> | |
<p>Sorry for the inconvenience and thank you for you cooperation. </p> | |
<p>See Roadside Dental Marketing support team for more info.</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When migrating a site, and there's a delay between cloning it to a new server, and updating the DNS to point to it, it's a good idea to lock down the admin dashboard to prevent edits. This will keep the two installs from getting out of sync, and avoid having to remigrate the site a second time.