簡體   English   中英

Laravel URL 重寫不適用於 Ubuntu 18.04

[英]Laravel URL rewrite is not working on Ubuntu 18.04

我可能已經嘗試了所有在線可用的解決方案。 仍然不明白為什么 URL 重寫在這個 Linode Ubuntu 18.04 VPS 中對我不起作用。

.htaccess 選項 -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}]

來自 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>

任何線索都受到高度贊賞。

請先檢查 mod rewrite 是否啟用。

還要檢查虛擬主機文件 www 中的目錄指令,並且 html 丟失/我相信。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM