apache - htaccess Redirect sub directories except index.php -
i have htaccess file in www.mydomain.com/dir.
i want redirect requests www.mydomain.com/dir/* www.mydomain.com/dir except www.mydomain.com/dir/index.php
i tried this:
rewriteengine on rewritecond document_root/ !-f rewriterule ^/*$ index.php
what doing wrong?
that works almost!
www.mydomain.com/dir/.htaccess:
options +followsymlinks -multiviews rewriteengine on rewritebase /dir/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule (?!^index\.php$)^.+$ index.php [l,nc]
but when access file or sub directory in dir 404. index.php located in dir , request file or sub directory in dir should redirected dir/index.php.
Comments
Post a Comment