Not work
darklove2501 opened this issue · 2 comments
This is my .htaccess.
I put router at index.php
But it doesn't works
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /index.php [NC,L,QSA]
Hi
I afraid I haven't used apache for a long time so I can't offer an exact solution. Can you see which part of your set up is not working? Are you seeing error messages on your screen/terminal? Have you checked your apache error logs? Are you getting 404s? 500s? PHP Exceptions?
It would be good if you could provide a bit more information when submitting a request for help. This is a really good (but a bit long) essay on how to effectively submit bug requests http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
Thanks!
I have run into this exact same issue. In my case everything works perfectly if I run php -S localhost:8080
, but as soon as I drop the application in the /var/www/html
directory and let apache be the web server, then it looks like it resolves all routes to physical paths on disk, resulting in 404 errors for everything but only for /
. When I add /index.php
, there's an error:
[Sun Nov 20 00:05:58.764880 2016] [:error] [pid 19182] [client 90.200.52.116:62009] PHP Fatal error: Uncaught Phroute\\Phroute\\Exception\\HttpRouteNotFoundException: Route index.php does not exist in /var/www/html/vendor/phroute/phroute/src/Phroute/Dispatcher.php:218\nStack trace:\n#0 /var/www/html/vendor/phroute/phroute/src/Phroute/Dispatcher.php(123): Phroute\\Phroute\\Dispatcher->dispatchVariableRoute('GET', 'index.php')\n#1 /var/www/html/vendor/phroute/phroute/src/Phroute/Dispatcher.php(47): Phroute\\Phroute\\Dispatcher->dispatchRoute('GET', 'index.php')\n#2 /var/www/html/index.php(54): Phroute\\Phroute\\Dispatcher->dispatch('GET', '/index.php')\n#3 {main}\n thrown in /var/www/html/vendor/phroute/phroute/src/Phroute/Dispatcher.php on line 218
Out of curiosity @mrjgreen , what do you use to make phroute work without the PHP server (such as a production environment)?
Edit: More info