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
  • 130,504
  • 14
  • 57
  • 93
Neil Lu
  • 169
  • 1
  • 12

1 Answers1

2

You can put the following in your htaccess file

RewriteEngine On

RewriteRule !index\.php /index.php [NC,L]
RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93
Amit Verma
  • 40,709
  • 21
  • 93
  • 115