View Full Version : Basic Redirect Writing

01-03-2011, 04:41 PM
This is a basic question about writing .htaccess Redirect.

I want to redirect a call to a directory to a sub-directory within that directory.

In my root directoryís .htaccess file, this works:

Redirect 301 /index.html /foldername/

But I canít get this to work in any other directory. Iíve tried many variations, such as --

Redirect 301 /foldername/index.html /foldername/subfolder/
Redirect 301 index.html /subfolder/

-- without result, so Iím wondering if I have some basic confusion about how this works.

Thank you.

01-03-2011, 04:52 PM
Redirect 301 foldername/(.*) /foldername/subfolder/$1 ?

01-03-2011, 06:01 PM
Thank you.

I'm still not getting it to work. Does that line of code go into an .htaccess within the "foldername" directory, or in the root directory's .htaccess, or ...?

01-03-2011, 09:21 PM
The "Redirect" directive doesn't support patterns. You need to use "Rewrite" or "RedirectMatch".