简体   繁体   中英

Redirect all URI to index.php, despite existence

I have a main page, index.php and I would like to redirect all URI to index.php despite the existence of the file/directory in the server. Basically, I would like to give priority to index.php over htaccess.

Currently, I have the following:

...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
...

Commenting the first and second line (in the excerpt above) throws an "Internal Server Error" which seems reasonable since that creates a circular logic but I am blind to any other implementations and am basically stuck. I would appreciate it if someone could shed some light.

Thank you.

 RewriteCond %{REQUEST_URI} !index\.php
 RewriteRule ^(.*)$ index.php/$1 [L,QSA]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM