Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

htaccess Temporary Redirect to Maintenance Page

Redirecting visitors to a maintenance page or other temporary page is most important thing while you are updating your site and don't want users to access your site. Using htaccess you can redirect your visitors to a temporary maintenance page. All you need to redirect your visitors is the following code placed in your site’s root htaccess:

htaccess Temporary Redirect to Maintenance Page

RewriteCond %{REQUEST_URI} !maintenance.html
RewriteCond %{REQUEST_FILENAME} !(styles|images).+$
RewriteCond %{REMOTE_ADDR} !^555\.555\.555\.555$
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteRule (.*) /maintenance.html [R,L]

This code makes it easy to temporarily put down your website for updates.

Note: If you only want to access site, you need to change "REMOTE_ADDR" with your own IP address. Images and styles are allowed to pass through the filter as well.

Please support us, Like us on Facebook.

0 comments:

Post a Comment

 

Copyright @ 2017 HKBlog.