: Pretending a file is in subdirectory with .htaccess I have a web application, and it has a RESTful PHP backend that uses Zend framework (which does its own URL rewriting magic). The problem
I have a web application, and it has a RESTful PHP backend that uses Zend framework (which does its own URL rewriting magic).
The problem is, my backend's entry-page is api.php and the endpoints look like:
api.php/resource1
api.php/resource2/id
All I want to do is remove the .php file extension so my URLs look a little cleaner.
Is there any way of doing this without removing the file extension from the PHP file?
More posts by @Holmes151
2 Comments
Sorted by latest first Latest Oldest Best
Try this to just remove .php:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /.php/ [L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.