去除url中的.php .html .jsp等后缀;
例如我要访问localhost/logout这样的url 会访问的是 ??localhost/logut.php
只需要在项目目录下面创建一个 .htaccess的文件
<IfModule mod_rewrite.c>RewriteEngine on ?//on为打开,off为关闭RewriteRule ^logout$ logout.phpRewriteRule ^login$ login.php</IfModule>前提是apache开启rewrite
URL去除.php或.html等后缀
原文地址:http://blog.51cto.com/11760810/2299072