1

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?

RavinderSingh13
  • 117,272
  • 11
  • 49
  • 86
Neil Lu
  • 159
  • 2
  • 10

1 Answers1

2

You can put the following in your htaccess file

RewriteEngine On

RewriteRule !index\.php /index.php [NC,L]
RavinderSingh13
  • 117,272
  • 11
  • 49
  • 86
Amit Verma
  • 39,545
  • 18
  • 87
  • 107