I have moved my site from Windows to Ubuntu. Now, I am using Ubuntu
with Apache
. I can access the root of the site, but all routes are with 404 error.
This is /etc/apache2/apache2.conf
:
<Directory /var/www/project_folder/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
This is site config file:
ServerAdmin webmaster@localhost
DocumentRoot /var/www/project_folder/public
ServerAlias www.url here
ServerName url here
And this is .htaccess
:
AddType text/css .css
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
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]
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire