I tried the following configuration to delete the public folder from laravel, first rename the server.php to index.php then I added the htaccess with the following rules
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
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} !(\.json|\.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|img|fonts|audios|imagenes|config)/(.*)$ public/$1/$2 [L,NC]
</IfModule>
It works for images, styles, js without problems, the detail is at the moment of accessing my woff files, I have the 404 error since it tries to search in http://miip.com instead of http://miip.com/project , the fonts with compiled with laravel mix.
How can i fix this?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire