Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Set a file as the catch-all handler with .htaccess

This is what’s in the root directory of the locally hosted web app

|- index.php
|- feed.php
|- .htaccess

I want to direct all the requests to index.php, no matter what the requested uri is. E.g., I want the server to execute index.php even if feed.php is typed into the address bar.

How should I configure the .htaccess file so that the server work as I intend it to?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can put the following in your htaccess file

RewriteEngine On

RewriteRule !index\.php /index.php [NC,L]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading