Laravel只允许第一页工作



我将我的laravel 8应用程序部署到aws ec2实例,但它只有第一页是工作的

。Htaccess文件和index.php文件在根目录

。htaccess

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]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

站点/laraqueue.conf

<virtualHost *:80>
ServerAdmin support@ahtcloud.com
ServerName http://18.189.174.42
ServerAlias http://18.189.174.42
DocumentRoot /var/www/laraqueue/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/laraqueue/public>
Require all granted
AllowOverride All
Options Indexes Multiviews FollowSymLinks
</Directory>
</virtualHost>

Runsudo a2enmod rewrite

按照下面的代码更新你的配置文件

<Directory /var/www/laraqueue/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

重启apache服务器

service apache2 restart

最新更新