Solved

Redirect to maintenance page during upgrade using WAMP Aserver 2.0

Posted on 2012-03-26
4
423 Views
Last Modified: 2012-04-13
Hi

I know how to Redirect to maintenance page during upgrade using .htaccess in XAMPP. like this:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$ 

RewriteRule $ /maintenance.html [R=302,L]

Open in new window


I want to do the same in WAMP Aserver 2.0 or PHP or normal HTML. specially the Options +FollowSymlinks  .

the idea is that my current webserver is not XAMPP it is WAMP.

Any Howto?

regards,
0
Comment
Question by:zakwithu2012
4 Comments
 

Author Comment

by:zakwithu2012
ID: 37766574
Guys,
Any help please.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37768417
what is the value of AllowOverride in your main configuration file, shozld beAll
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 37768651
Here is how you can do it in PHP.  First the maintenance page.
<h1>Maintenance</h1>

Open in new window

Then the general purpose script that gets included at the top of every page.
<?php // RAY_temp_zakwithu2012.php.php
error_reporting(E_ALL);


// DEMONSTRATE HOW TO REDIRECT EVERYTHING TO THE MAINTENANCE SCRIPT


// THE NORMAL SETTING
$maintenance=FALSE;

// THE DEMONSTRATION SETTING
// $maintenance=TRUE;

// IF MAINTENANCE IS IN PLAY
if ($maintenance)
{
    // CONSTRUCT THE URL WE WANT
    $my_uri
    = '/maintenance.html'
    . '?'
    . $_SERVER["QUERY_STRING"]
    ;

    // BAIL OUT WITH AUTOMATIC 302 AND LOCATION
    header("Location: $my_uri");
    exit;
}
echo "<h1>Not Maintenance</h1>";

Open in new window

See also the note here that header("Location") automatically sends the 302 Moved Temporarily header, unless you override it.
http://php.net/manual/en/function.header.php
0
 
LVL 33

Expert Comment

by:shalomc
ID: 37769832
I have yet to find an apache directive that doesnt work on windows.

So, exactly the same method you used before should work now.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RDM Dependencies on VMware 2 89
Autoresponder for Whole Domain in Plesk/Cpanel 2 86
System Analysis 5 61
How code a 301 redirect for folder files -> 1 file 2 58
This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question