.htaccesshttp-redirectmaintenance-mode

redirect request uri to mirror site using htaccess


I have a website. I created a mirror of it and uploaded it in a directory called 'mirror'. What I wanted to do is whenever a viewer access for example..

http://www.example.com/this-page/another-segment/?id=1

I want him to be redirected to..

http://www.example.com/mirror/this-page/another-segment/?id=1
                       ^^^^^^

(I am doing this because I want to want to edit my site's design but I don't want viewers to see the changes in progress until they are complete. Thus I want to redirect them to the mirrored snapshot, at least temporarily.)

Please suggest how this can be done using .htaccess or not.


Solution

  • after browsing around the internet. i came up with the idea of putting a /$1, a rewritebase and followsymlinks on the answer givien by appclay

    Options +FollowSymLinks
    RewriteEngine On 
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/mirror/
    RewriteRule (.*) /mirror/$1 [R=301,L]