.htaccess - How to force htaccess to index.php if no file or parameters specified -


i want if user enters site url without specifying file or parameters site.com or site.com/ , should redirected site.com/index.php if enter file site.com/somefile.php or give parameters site.com/?param=val , htaccess should not , let run.

in .htaccess, add line:

directoryindex index.php 

this way apache index.php requests yoursite.com & yoursite.com/. there no need add rewrite condition rule! plus, servers don't allow rewrite conditions.

in wamp, rewrite disabled default.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -