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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -