我正在尝试将我的项目上载到服务器。第一页工作正常,当我转到另一页时,出现诸如The requested URL was not found on this server.
Apache/2.4.29 (Ubuntu) Server at 142.93.209.171 Port 80
之类的错误。我认为问题出在.htaccess
文件中,这是我的.htaccess
文件放在公共目录中
<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]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
这是我的app_url
放在.env
文件中
APP_URL=http://142.**.***.***/
这是虚拟主机配置
DocumentRoot /var/www/studio/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/studio/public>
Options +Indexes +Includes +FollowSymLinks +Multiviews
AllowOverride All
Require all granted
</Directory>
我尝试了很多,但总是遇到404
错误