当我把这个
<a href="{{ Route('admin.edit', $consignment->id )}}" >...</a>
我得到这个链接:localhost:8000/dashboard/edit?3
我想让网址像:localhost:8000/dashboard/edit/3
我应该怎么办 ?你能帮帮我吗?
当我把这个
<a href="{{ Route('admin.edit', $consignment->id )}}" >...</a>
我得到这个链接:localhost:8000/dashboard/edit?3
我想让网址像:localhost:8000/dashboard/edit/3
我应该怎么办 ?你能帮帮我吗?
在切换到 nginx 之前,我有一个类似的问题,当使用 apache 时,我似乎丢失了漂亮的 url,我必须做两件事来修复它。首先在您的目录中创建一个.htaccess
文件public/
并将其作为内容:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
第二件事是我的项目根文件夹中有一个server.php
我不得不重命名为index.php
不知道项目的所有细节的情况下很难确定会发生什么,但这对我来说是完全相同的问题。祝你好运