I
I
Ivan Vorobei2016-04-13 16:01:48
Apache HTTP Server
Ivan Vorobei, 2016-04-13 16:01:48

How to remove public/index.php from URL in Lumen?

Inside the public folder there is a .htaccess with a redirect to index.php
But you have to add the address to the public folder in the URL :
http://example.com/project/public/
I tried redirecting to the folder, but it does not work.

<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

I sent Laravel to the server.php file, which is at the root - everything worked. Lumen does not work. Shared hosting complicates the situation

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Vorobei, 2016-04-15
@ivanvorobei

The problem was the folder hierarchy. The api.example.com subdomain contained project folders. Accessing the project
The folder contained the htaccess specified in the question. The redirect did not work because instead of referring to the project, there was a call to the public folder.
Solved by specifying the project name in htaccess

<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ project/public/$1 [L]
</IfModule>

V
Viktor Taran, 2016-04-13
@shambler81

DirectoryIndex won't work?
I'm already silent about a normally configured virtualhost

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question