Php Laravel主页url不工作?
当我打开主页url时:它会将我重定向到并提供 错误404 htaccess文件是默认文件,它过去工作得很好,我不知道出了什么问题 以下是.htaccess:Php Laravel主页url不工作?,php,.htaccess,laravel,laravel-routing,Php,.htaccess,Laravel,Laravel Routing,当我打开主页url时:它会将我重定向到并提供 错误404 htaccess文件是默认文件,它过去工作得很好,我不知道出了什么问题 以下是.htaccess: <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder.
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
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]
尝试使用以下.htaccess文件:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
尝试将RewriteBase添加到htaccess文件
你应该发布你的htaccessfile@JoachimMartinsen我是默认的Laravel.htaccess,你在运行什么web服务器?@JoachimMartinsen我在使用wamp
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /laravel/public/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]