Forum Moderators: phranque

Message Too Old, No Replies

Permanant redirect for a specific directory?

         

brakkar

9:17 pm on Mar 7, 2004 (gmt 0)

10+ Year Member



Hello,
in my /www/ I currently have an .htaccess that contains:


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.mysite\.com
rewriterule (.*) [mysite.com...] [R=permanent,L]

So mysite.com will redirect to www.mysite.com.

I would like to add an additional feature in my .htaccess (or in another .htaccess) so: www.mysite.com/directory/ (and www.mysite.com/directory/index.php) will have a permanent redirect to www.mysite.com .

How should I do this?
Shoud I add something to the current .htaccess? Or should I place a new .htaccess in the /www/directory/?
And what should I put in it?

Thanks in advance,
Brakkar

jdMorgan

1:23 am on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Brakkar,

You can do this easily by adding another rule after the one you posted above.


RewriteRule ^directory(/index\.php)?$ http://www.mydomain.com/ [R=301,L]

Jim