Editable WP.blogspot.com

Redirecting Guests to a Momentary Upkeep Web page in WordPress and not using a Plugin

Redirecting Guests to a Momentary Upkeep Web page in WordPress and not using a Plugin

Yesterday, we confirmed you the way to quickly redirect your guests to a maintenance page in WordPress using popular plugins. That methodology is nice, however some builders desire to get their palms soiled by going the non-plugin route. Nicely on this article, we'll present you the way to redirect guests to a brief upkeep web page in WordPress and not using a plugin.

This publish is a part of a Collection

Redirecting Visitors a Temporary Maintenance Page in WordPress with Maintenance Mode Plugin

Six Types of Maintenance Page Designs – Which One Works for You?

.htaccess Methodology

One methodology is by way of .htaccess that permits solely single IP to entry the location. This can be a fast snippet for a single-developer undertaking.

# MAINTENANCE-PAGE REDIRECT
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond % !^123\.456\.789\.000
 RewriteCond % !/upkeep.html$ [NC]
 RewriteCond % !\.(jpe?g?|png|gif) [NC]
 RewriteRule .* /upkeep.html [R=302,L]
</IfModule>

Mainly, all you would wish to do is change the Remote_Address to your IP deal with. Then, you would wish to create a web page referred to as upkeep.html, and magnificence it to nonetheless you want. This must be saved in your root listing. The code principally helps you to see the complete web site, and everybody else will get the upkeep.html web page.

If you wish to permit a number of IP addresses, then use this method:

<Restrict GET POST PUT>
 order deny,permit
 deny from all
 permit from 123.456.789
 permit from 123.456.789
</LIMIT>
ErrorDocument 403 /custom-message.html
<Information custom-message.html>
 order permit,deny
 permit from all
</Information>

Merely add as many IP addresses you wish to permit. Everybody else will get the web page “custom-message.html”. You'll be able to add no matter you want within the file.

Actually, we expect by going the WordPress maintenance plugin route is loads simpler. Query to customers: Why do you assume the non-plugin route is healthier?

Observe: Brad Williams within the remark identified that there's one other methodology of doing this which is definitely built-in with WordPress. Try Matt “Sivel” Martz’s Collection Publish (1), (2), (3)

Sources

Perishable Press (1), (2)

Tutorials