繁体   English   中英

如何在laravel 5.2中制作漂亮的网址?

[英]how to make pretty url in laravel 5.2?

我是laravel的新手我只是尝试将每个路由中的index.php(例如https://localhost/test/public/index.php/test1)删除到https:// localhost / test / public / test1中 我可以使用mod_rewrite代码来解决这个问题但不起作用。 我在.htaccess文件中的代码可以在公共文件夹中,如下所示: -

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

它显示错误

The requested URL /test/public/test1 was not found on this server

尝试这个

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM