totoaussi totoaussi - 5 months ago 14
Apache Configuration Question

.htaccess : how to redirect folder to his subfolder?

I have a web page and his url is

But I want to redirect (301) the to because the content of is empty.

My rewrite rule is the follow :

RedirectPermanent /category/ /category/door/

But it doesn't work, because the browser redirect to infinitely.

An idea ? Thank you.


Try this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/category/door
RewriteRule ^category/$ /category/door/ [QSA,L,R=301]