Answer the question
In order to leave comments, you need to log in
How to install Laravel on a server in a subfolder?
The task is a bit non-trivial, the search did not give intelligible answers.
We have: a web server on ubuntu, on board Apache and PHP 7.
The server itself does not have a domain name, only an ip address like 192.168.100.8
Many projects were installed on it at one time, and in the end the structure looks like this:
192.168.100.8
var/www/html:
Answer the question
In order to leave comments, you need to log in
I came across some more thoughts, maybe it will help someone in the future a lot.
In the root folder, you need to change the name of the server.php file to index.php
and paste the code below into the .htaccess file in the same place.
But after this, the layout is still going, most likely you need to transfer something from the public folder.
Options -MultiViews -Indexes
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
yes, in htaccess you need to redirect requests index.php to public/ index.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question