Laravel public folder returns 404 error (.htaccess)
P粉238433862
P粉238433862 2023-07-28 18:04:13
0
1
397
<p>I have a .htaccess file. Through this file I can detect the language by subdomain. There is no problem in this regard. However, when I redirect the incoming request to a file under the public folder, I get a 404 error and the language doesn't work properly. </p> <pre class="brush:php;toolbar:false;">SetEnv DEFAULT_LANG en <IfModule mod_rewrite.c> Options FollowSymLinks -Indexes RewriteEngineOn RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteCond %{HTTP_HOST} ^([a-z]{2}).([a-z0-9-] .[a-z] )$ [NC] RewriteRule (.*) - [QSA,E=LANGUAGE:%1] RewriteCond %{ENV:LANGUAGE} ^$ RewriteRule (.*) - [QSA,E=LANGUAGE:en] RewriteCond %{QUERY_STRING} !language= RewriteRule ^(.*)$ $1?language=%{ENV:LANGUAGE} [QSA] RewriteCond %{REQUEST_URI} !^/public RewriteRule ^(.*)$ /public/$1 [L] </IfModule></pre> <p><br /></p>
P粉238433862
P粉238433862

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!