Advanced Search

Results 1 to 5 of 5

Thread: .htaccess redirect while upgrading site.

  1. #1
    Join Date
    Nov 2007
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default .htaccess redirect while upgrading site.

    I need to redirect users from my current site to a sub directory while I implement the new website, whilst excluding my IP so that I can work on the new site.

    The old site is Html based, and the new site is Wordpress based.

    Any user that goes to the www.domain.com should be redirected to www.domain.com/old/
    The same for any pages ie. www.doamin.com/page1.html >> www.domain.com/old/page1.html

    This is to allow me to install and work upon the new wordpress install in the root.

    I've found a lot of .htaccess examples which only divert the user to a single maintenance page, and I have had no luck trying to figure out how to do this. Any advice would be greatly appreciated.

    thanks.

  2. #2
    Join Date
    Jul 2008
    Posts
    199
    Thanks
    6
    Thanked 58 Times in 57 Posts

    Default

    Change 127.0.0.1 to your IP
    Code:
    RewriteEngine on
    RewriteCond %{REMOTE_ADDR} !(127.0.0.1)
    RewriteRule ^old/ - [L]
    RewriteCond %{REMOTE_ADDR} !(127.0.0.1)
    RewriteRule ^(.*) /old/$1 [R]

  3. #3
    Join Date
    Nov 2007
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks that works perfectly!

  4. #4
    Join Date
    Nov 2007
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    After I have made some changes to the new wordpress install - which has updated the htaccess - visitors now gets the following error:

    302 Found
    The document has moved here.
    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    Any suggestions?

    the htaccess looks like this:

    # Created by Redirection Module: Apache
    # Wed, 13 Aug 2008 22:11:18 +0100
    # Redirection 2.0.4 - http://urbangiraffe.com/plugins/redirection/

    <Files .htaccess,.svn>
    order allow,deny
    deny from all
    </Files>
    Options +FollowSymlinks

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^weddingmobilebarhire\.co\.uk$ [NC]
    RewriteRule ^(.*)$ http://www.weddingmobilebarhire.co.uk/$1 [R=301,L]

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ (.*)index\.[php|htm|html](.*)\ HTTP/
    RewriteRule ^(.*)index\.[php|html|htm](.*)$ $1$2 [R=301,NC,L]

    </IfModule>

    # End of Redirection
    RewriteEngine on
    RewriteCond %{REMOTE_ADDR} !(81.96.172.133)
    RewriteRule ^site/ - [L]
    RewriteCond %{REMOTE_ADDR} !(81.96.172.133)
    RewriteRule ^(.*) /site/$1 [R]
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

  5. #5
    Join Date
    Nov 2007
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    without messing up any of the actual wordpress plugin settings etc? or should I just cut my losses, get the template finished, take down the orig and then build the new site up?

    thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •