clixew"

Author Topic: [FREE] fjSnippet #6 - Maintenance Page Re-Director v1.0  (Read 1612 times)

0 Members and 1 Guest are viewing this topic.

  • Business Owner
  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 439
  • Karma: +45/-39
  • Lets Work Together
  • Referrals: 5
    • Revenue Sharing Program
[FREE] fjSnippet #6 - Maintenance Page Re-Director v1.0
« on: February 19, 2013, 04:11:35 PM »
It is a good practice to have a maintenance mode for your site. By this I mean you want your site visitors to get a warm acknowledgement that your site is not currently available.

First step, is to create a page that blends with your site theme and contains the outage message you want visitors to read. For example, call it maintenance.html and upload it to your site root folder.

Next you want to edit your .htaccess file and add the maintenance page re-director directives.

I am including a section of the htaccess file from my 408FJ Series script. For this topic we are just focusing on the Setup a maintenance page section of the code.

Code: [Select]

#This files has been modified as part of the release of the Aurora-Script 408FJ Series script.
#Modified Date: January 24, 2013

<Files .htaccess>
order allow,deny
deny from all
</Files>

ServerSignature Off
RewriteEngine On
Options +FollowSymLinks

#Next directive may cause 500 error on some servers
#It depends on how the sever have default directives configured
#Comment the following directive if necessary
Options All -Indexes

#Setup a maintenance page
#RewriteCond %{REQUEST_URI} !/maintenance.html$
#RewriteCond %{REMOTE_HOST} !^111\.111\.111\.111
#RewriteRule $ /maintenance.html [R=302,L]


Note in the Setup a maintenance page section you need to make sure that the filename matches the page you want displayed when your site is in maintenance mode.
Also, you want to replace the numbers 111 series with your own ip address. That way, you can access your site and no one else can while you are in maintenance mode.
All you have to do is remove the hash # character that is in front of the last three lines of code, save the file and replace the htaccess file on your site.

I usually use different versions of htaccess files depending on what I am doing and I just have to rename the one I want to use to be the current .htaccess
« Last Edit: February 21, 2013, 11:36:10 AM by fjworld »



 

advertise here