totoaussi totoaussi - 1 year ago 87
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.

Answer Source

Try this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/category/door
RewriteRule ^category/$ /category/door/ [QSA,L,R=301]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download