3
votes

I have created a folder in my localhost named "example".and I have added 4 files inside that folder.

  • index.php
  • about.php
  • .htaccess
  • 404.php

when I type the url http://www.localhost/example/123 (working fine) It is going to 404 error page.

when I type the url http://www.localhost/example/index.php/123 it is not redirecting to 404 page. the same happening FOR about.php and other php extension files in the example folder.

In my htaccess file I have re-directicted the non existing file ro 404 pages.But is not happening for the index.php,about.php..and all the files with php extension in the example folder.

the following is my current .htaccess file.

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

ErrorDocument 404 /404.php
1
I understand that you're not satisfied with your current .htaccess file. Can you give it in your question so that we can fix it ?Denys Séguret
@dystroy...the following is my htaccess file... RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ErrorDocument 404 /404.phpImthiyaz
@dystroy..I have added my htaccess file in the question..Please look into it and let me know your response.Imthiyaz

1 Answers

1
votes

If you want to explicitly disable path info then you must use the AcceptPathInfo directive.

AcceptPathInfo Off