Solved

Redirect to maintenance page during upgrade using WAMP Aserver 2.0

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

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…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
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…
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…

724 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