...

View Full Version : Basic Redirect Writing



keys88
01-03-2011, 03: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.

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

keys88
01-03-2011, 05: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 ...?

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum