I'm working on an microservice based arhitecture with Lumen. The local environement is working fine, but the production server needs adjustments, because it can't have the same link structure, and I want the code to be the same in every env.
In the local env I created virtual hosts for every microservice, like for e.g. books.xyz, and authors.xyz that point to the /public folder, so link structure DOESN'T contain public. On live, it is hosted like server .servername.com/books and beta.servername.com/authors. I have started developing an admin panel with lumen ( /admin ) but the problem is that the link structure is too different, and doesn't work on production. ( css/js assets get 404'd etc.)
How can I remove the /public in the production URL?
I don't want to move everything from public folder into root, because of security reasons!
I have tried creating a .htaccess file on the root, and the following, but none of them worked :
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{REQUEST_URI} !^/books/public/
# RewriteRule ^(.*)$ /public/$1 [L,QSA]
# RewriteRule ^game/(.*)$ /books/public/$1 [L,QSA]
# </IfModule>
or
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteRule ^(.*)$ books/public/$1 [L]
# </IfModule>
or
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ books/public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php