Htaccess can't redirect home directory


#1

So, I’m trying to 301 my root directory to a sub directory - my .htaccess redirect works fine from the sub directory to the root, but not the other way around.

Works fine:
Redirect 301 /sub-directory http://www.mydomain.com

Doesn’t work:
Redirect 301 / http://www.mydomain.com/sub-directory

It trys to redirect to a url like this:
http://www.mydomain.com/sub-directorysub-directorysub-directory-subdirectory etc.


#2

Actually it is working just fine.

After reading the documentation one would come to the conclusion thatRedirect 301 / http://www.mydomain.com/sub-directoryis a bad idea!

:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


#3

Just use a php redirect like index.php:

<?php header( 'Location: http://www.yoursite.com/new_page.html' ) ; ?>

Save [color=#CC0000]$97[/color] on Dreamhost plans by using promo code: [color=#CC0000]SRVR97[/color]