0

I am trying to access a php file located under a directory without the .php extension.

http://mydomain/Test/Products/Models

I am getting this error:

**Not Found**
**The requested URL /Test/Products/Models was not found on this server.**

If I use this, it works fine:

http://mydomain/Test/Products/Models.php

My htaccess files contains this php handler part:

 <IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME}.php -f
   RewriteRule ^([a-z]+)\/?$ $1.php [NC]
 </IfModule>

What do I need to change in my htaccess code so I can access files located in a directory without the .php extension

Thanks in advance.

Nic3500
  • 8,144
  • 10
  • 29
  • 40
  • Possible duplicate of [Remove .php extension with .htaccess](https://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – BenM Jul 20 '18 at 17:38
  • Regex is case sensitive, `a-z` will not match `Models`. Look at the link suggested by @BenM, it has a nice answer you can use. – Nic3500 Jul 20 '18 at 17:46

0 Answers0