?
Solved

Redirect to maintenance page during upgrade using WAMP Aserver 2.0

Posted on 2012-03-26
4
Medium Priority
?
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 111

Accepted Solution

by:
Ray Paseur earned 1500 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

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

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

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…
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 make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

770 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