Level 8
Why do you even want to rewrite this with a htaccess file? You're not in control of renaming your routes?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Im doing an api with Lumen, Im trying to remove the public folder from the url, (Im sure I will do that when I host the Api somewhere)
I do htaccess on the root something like: (I did many many htaccess by the way, lot of try)
RewriteEngine On
RewriteRule ^(.*)$ public/ [L]
http://localhost/store/
http://localhost/store/api/v1/users
http://localhost/store/public/
http://localhost/store/public/api/v1/users
I get the response with no problem
php -S localhost:8000 -t public
http://localhost:8000/api/v1/users
also works
Please or to participate in this conversation.