[英]Remove index.php from url Laravel 5
URL在我的應用程序中運行良好。 我的意思是它們是漂亮的網址。 像http://www.example.com/一樣,但是當您使用index.php這樣的頁面(例如http://www.example.com/index.php)訪問該頁面時,它也可以工作,因為它顯示兩個站點地圖中的一頁鏈接。 一頁沒有index.php ,另一頁沒有index.php 。 站點地圖的演示在這里https://www.xml-sitemaps.com/details-eln.6762418.html
這是.htaccess文件
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
輸入以下代碼:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,7}\s/(.*)index\.php\sHTTP.*$
RewriteRule ^ /%1 [R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.