原文博客地址https://www.xiegaosheng.com/site/index
去除url中的.php .html .jsp等後綴;
例如我要訪問localhost/logout這樣的url 會訪問的是 localhost/logut.php
只需要在項目目錄下面創建一個 .htaccess的文件
<IfModule mod_rewrite.c>
RewriteEngine on //on爲打開,off爲關閉
RewriteRule ^logout$ logout.php
RewriteRule ^login$ login.php
</IfModule>
前提是apache開啓rewrite