문제

I want to redirect a nonexistent virtual folder when it is directly accessed to the root domain but not files from within it. How to get this? Right now I can only redirect the full directory, including all files, to the domain with this in my .htaccess file:

RedirectMatch 301 /features http://example.org/
도움이 되었습니까?

해결책

The redirect is incorrect, should be:

RedirectMatch 301 ^/features/?$ http://example.org/

So you'll match only the path and not the files. Consider also that with this solution the slash after the directory features is optional.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top