View Full Version : htaccess 301 help

08-17-2007, 05:06 PM

I have moved a folder on a site and I am wanting to do a 301 redirect on the old folder.

So I have created my .htaccess file and included this:

Redirect 301 /sites/ http://www.mysite.com/links/

This works and redirects however if the user visits sites/cat/animals/ it will redirect to links/cat/animals/

So I am basically needing a way for it to drop anything after sites/. Is this possible?

08-17-2007, 06:32 PM
Yes it's certainly possible using regular expressions. Though, this isn't a PHP question, it probably belongs in "other server side languages/issues" or "general web building".

But in the meantime you can look up mod_rewrite regular expressions and take a stab yourself.