Thread: 301 Redirect
View Single Post
Old 03-10-2021, 11:48 PM   #3
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
Join Date: Apr 2005
Posts: 170
I set up a test at

In the root directory I have just an index.htm page that will show "Main Page".

I have a subfolder called subfolder1. in there is an .htaccess file that looks like this:

RewriteEngine On
RewriteRule ^(.*)$ ../

In there is also another index.htm page that if it gets hit will show "subfolder1"

So anything hitting there should be redirected to the main folder one step down. And it does that.

Inside of subfolder1 I have a subfolder called subfolder2. That has an index.htm page that will show "subfolder 2" if it gets hit. There is no .htaccess file in subfolder2.

So the .htaccess folder in subfolder1 controls the rules and subfolder2 never shows because the hit is redirected to the Main folder.

Inside subfolder2 I have a subfolder called (can you guess?, yeppir), subfolder3. That has an index page that when it gets hit will show subfolder 3. It also has an .htaccess file with just one line RewriteEngine Off

That turns off the redirect at that level and lets you see subfolder3.

So, like I say, you should be able to do the redirect of everything subfolders and all with just 1 htaccess file at the proper level.

Hope that helps and I hope it answered the question, lol. Hate to type that much and find out I misinterpreted the question.


Last edited by sarettah; 03-10-2021 at 11:51 PM..
sarettah is offline   Reply With Quote