.htaccess folder rewrite

Posted by Lisa on Server Fault See other posts from Server Fault or by Lisa
Published on 2010-05-05T13:03:48Z Indexed on 2010/05/05 13:08 UTC
Read the original article Hit count: 273

Filed under:
|

I have 3 URLS all pointing to the same site.

  • www.abc.co.uk
  • www.xyz.com
  • www.123abc.org

I have a folder /foo/bar which has lots of sub folders and files in etc. I want to rewrite this to /bar.

So if I have www.abc.co.uk/foo/bar/sheep/page.html I want it to redirect to www.abc.co.uk/bar/sheep/page.html. Is this possible.

Sometime I may have a URL like www.abc.co.uk/foo/bar/foo/page.html so this would become www.abc.co.uk/bar/foo/page.html. Only the first instance of foo would be rewritten.

© Server Fault or respective owner

Related posts about apache

Related posts about .htaccess