Solved

Redirect to maintenance page during upgrade using WAMP Aserver 2.0

Posted on 2012-03-26
4
426 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 110

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

733 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