Results 1 to 4 of 4

Thread: .htaccess for my temporary web address?

  1. #1
    Join Date
    Feb 2009
    Posts
    5

    Red face .htaccess for my temporary web address?


    Just trying to avoid downtime while I move all my sites over to bluehost but my htaccess isn't working.

    This is what I have currently that works on a different server:
    Code:
    RewriteEngine On
    
    RewriteRule ^([^/\.]+)/?$ page.php?id=$1
    Didn't work for my temporary web address at http://66.147.242.152/~ryanflor/

    I got a sample file from support that looks like this:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^(.*)$ http://www.domain.com/folder/$1 [R=301,L]
    I switched the file from support to this:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^66.147.242.152$
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^/(.*)$ http://66.147.242.152/~ryanflor/page.php?id=$1 [R=301,L]
    I'm simply trying to get something like this:


    to redirect to


    I have a hunch I won't have any problems when I actually switch the name servers and plop my domain in the file and get rid of the whole ipaddress/~ryanflor thing, but I don't want any downtime and want to make sure my htaccess files are working.

    Does it work differently for the temporary domains?

    Any tips and help would be much appreciated. Thanks a ton.

  2. #2
    Join Date
    Jan 2008
    Location
    cardboard box
    Posts
    388

    Default

    Code:
    RewriteEngine On
    RewriteRule ^([^/\.]+)/?$ /~ryanflor/page.php?id=$1
    Have you tried turning it off and on again?

  3. #3
    Join Date
    Feb 2009
    Posts
    5

    Default

    Fantastic, it works, thank you.

    I don't know how I missed that one--I tried about 10 different lines similar to this--us designers get nervous when we look at htaccess code

  4. #4
    Join Date
    May 2009
    Posts
    1

    Default .htaccess for temp web site address

    Hi, like 'rpflo' above, I am having trouble with .htaccess on my temp site address. I am using the code from KB article 347, though it may be more than I need.

    My goal is simply to point to a subdirectory, to allow me to manage my default domain as I would a sub domain.

    From:
    http://66.147.242.174/~acidharm/

    To:
    http://66.147.242.174/~acidharm/acidharma/index.html

    So, I am using this code:


    RewriteEngine on
    # Change yourdomain.com to be your main domain.
    RewriteCond %{HTTP_HOST} ^ /~acidharm/$

    # Change 'subfolder' to be the folder you will use for your main domain.
    RewriteCond %{REQUEST_URI} !^/acidharma/

    # Don't change this line.

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # Change 'subfolder' to be the folder you will use for your main domain.

    RewriteRule ^(.*)$ /acidharma/$1

    # Change yourdomain.com to be your main domain again.
    # Change 'subfolder' to be the folder you will use for your main domain
    # followed by / then the main file for your site, index.php, index.html, etc.

    RewriteCond %{HTTP_HOST} ^ /~acidharm/$
    RewriteRule ^(/)?$ /~acidharm/acidharma/index.html [L]



    I have tried innumerable combinations, any help is appreciated.

Posting Permissions

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