#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    England, UK
    Posts
    83
    Rep Power
    15
    Hello,
    Say I was having some problems with my site and didn't want anyone to see it while I was making changes.
    How would I (using .htaccess) redirect every page (except /123.php) to 123.php.

    eg.
    user goes to: http://www.musicgoeson.com/artists/fgth/
    I don't want them to see this page, I want them to see 123.php

    How can I do this?

    Thanks

    Girish Gupta

  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    Let's assume 123.php resides at -> http://www.musicgoeson.com/123.php

    Place an .htaccess with the following few lines to http://www.musicgoeson.com/.htaccess

    #############################################
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/123.php$
    RewriteRule (.*) http://www.musicgoeson.com/123.php [R]
    #############################################

    The 2nd line means any REQUEST_URI EXCEPT the exact /123.php will follow the rewrite rule

    The 3rd line means anything including requesting an image from your site will be redirected to /123.php. So if your 123.php has no images, then you don't have to worry about it.

IMN logo majestic logo threadwatch logo seochat tools logo