Solved

Redirect to maintenance page during upgrade using WAMP Aserver 2.0

Posted on 2012-03-26
4
413 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
Comment Utility
Guys,
Any help please.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
what is the value of AllowOverride in your main configuration file, shozld beAll
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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 32

Expert Comment

by:shalomc
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to insert an Iframe into 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 : Open Page or Post…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now