Forum Moderators: phranque

Message Too Old, No Replies

Need help for redirection from directory

can someone explain me how to do that?

         

followgreg

12:31 am on Feb 4, 2006 (gmt 0)

10+ Year Member




Guys,

Ok my mod_rewrite skills suck! - For some reason I can not make the simple following to happen:

Permanently redirect /directory/anypage.html
to /anypage.html

When I say 'anypage' it means whatever page in the /directory/ should be redicted to its equivalent but in the root.

Please help :)

Thx

milanmk

12:56 am on Feb 4, 2006 (gmt 0)

10+ Year Member



RedirectMatch 301 /directory/(.*) http://example.com/$1

jdMorgan

1:52 am on Feb 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or for .html files and .html files only:

RedirectMatch 301 ^/directory/([^.]+\.html)$ http://example.com/$1

-or-

RedirectMatch 301 ^/directory/([^.]+)\.html$ http://example.com/$1.html

Jim

followgreg

6:24 am on Feb 4, 2006 (gmt 0)

10+ Year Member




I think that this is the best part of this forum!

THANK YOU! :)

I will try this right away.