PDA

View Full Version : .htaccess for my temporary web address?



rpflo
02-16-2009, 07:26 PM
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:

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:

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:


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:


http://66.147.242.152/~ryanflor/lamesauce

to redirect to


http://66.147.242.152/~ryanflor/page.php?id=lamesauce

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.

wysiwyg
02-17-2009, 12:40 AM
RewriteEngine On
RewriteRule ^([^/\.]+)/?$ /~ryanflor/page.php?id=$1

rpflo
02-17-2009, 04:52 AM
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:D

acidharm
05-18-2009, 07:38 PM
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.