php - Laravel Routes not working 404 not found
问题描述
我更换了我的电脑并在 Windows 10 WSL 上安装了灯。主索引有效/但路线无效。这是我的虚拟主机文件。
<VirtualHost 127.0.0.2:80>
DocumentRoot /var/www/devroot/lara/panel/public
DirectoryIndex index.php
<Directory "/var/www/devroot/lara/panel/public">
Options All
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
这是来自项目的 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]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
当我访问路由链接时出现错误。
Not Found
The requested URL /lara/panel/public/admin was not found on this server.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80
解决方案
问题是htaccess被隐藏了我的坏我将它从_htaccess修改为.htaccess,现在它正在工作。
推荐阅读
- heroku - 在 Heroku 中连接 AWS RDS 时找不到驱动程序
- angular - 如何将 http:// 重定向到 https://,如 firebase 托管
- flutter - 标签栏中的抽屉也显示在 sliver 应用栏中
- java - 如何修复此错误“渲染期间引发异常:找不到维度资源匹配值 0x1050050”?
- c# - 我可以先在数据库中导入后使实体模型奇异吗
- python - 异步任务取消
- python - 通过这个小测试用例,我是否有理由继续达到我的每日查询限制?
- html - 使用带方向的宽度
- python - actualSolve raise PulpSolverError("CPLEX_PY: Not Available")
- google-tasks-api - Google Task API 不再显示通过日历上的 API 创建的任务