简体   繁体   中英

Laravel URL rewrite is not working on Ubuntu 18.04

I have probably tried all the solution available online. Still dont understand why URL rewrite is not working for me in this Linode Ubuntu 18.04 VPS.

.htaccess Options -MultiViews

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]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

From apache2.conf

<Directory /var/www>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

/etc/apache2/sites-available/regenucell.com.conf

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@regenucell.com
  ServerName  regenucell.com
  ServerAlias regenucell.com  www.regenucell.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/html/regenucell.com/public_html/mms/public
  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/html/regenucell.com/log/error.log
  CustomLog /var/www/html/regenucell.com/log/access.log combined
  <Directory "/var/wwwhtml/regenucell.com/public_html/mms/public">
    Options FollowSymLinks
    AllowOverride All

    Order allow,deny
    Allow from all
  </Directory>

</VirtualHost>

Any clue is highly appreciated.

Please check mod rewrite is enabled first.

Also check directory directive in your virtual host file www and html is missing/ I believe.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM