Answer the question
In order to leave comments, you need to log in
How to overwrite path to all files in .htaccess?
I downloaded the backup of the site on Laravel from the hosting to the local machine with OpenServer. Accordingly, the question arose with the paths in the .htaccess file.
The current folder structure is as follows: D:\OpenServer\domains\local.site\web\site.ru\public_html
It is necessary that when entering the main page, which corresponds to the local.site folder, all file paths are taken relative to the \web\site folder. en\public_html.
I assume that you need to use the RewriteRule rule, but I don’t understand how.
I'm trying to do this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^local\.site$ [OR]
RewriteCond %{HTTP_HOST} ^www\.local\.site$
RewriteCond %{REQUEST_URI} !^/web/site.ru/public_html/
RewriteRule (.*) /web/site.ru/public_html/$1
php_flag short_open_tag off
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question