Take the 2-minute tour ×

I'm with an issue with .htaccess and I hope you can help me out.

Basically I have the following structure:

       + _archive
       + index.html
       + folder1
       + folder2
       + css
       + ...

On archive I have a few folders that I want it to be accessible through the root of my site.

So let's say my site calls rafael.com, so I would have the following archives:


I want them to be accessible from (without _archive):


But also having the folders and css, and images and etc on my root to keep working. Keep in mind that under folder10, folder20, folder30 I also can have their own images and css, and javascript.

Well, I'm trying the following .htaccess

RewriteEngine On
RewriteCond $1 ^(folder10|folder20|folder30)
RewriteRule ^(.*)$ _archive/$1 [L]

and that works fine if I call using http://www.rafael.com/folder30/ (WITH SLASHES IN THE END) my problem is when I try to call http://www.rafael.com/folder30 without the slashes it gets REDIRECT to http://www.rafael.com/_archive/folder30/ .

So can anyone explains to me WHY it's being redirecting it and how do I fix it in order to have http://www.rafael.com/folder30 and http://www.rafael.com/folder30/ working without redirecting it? :)

Thank you in advanced.

share|improve this question
add comment

1 Answer

Do you have any other rules in place? without an [R=30x] flag it shouldn't visibly redirect the url. Also you need to fix your RewriteCond $1 to something like this:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^folder(10|20|30)
RewriteRule ^(.*)$ /_archive/$1 [NC,L]
share|improve this answer
add comment

Your Answer


