从URL中删除.php扩展名

时间:2012-09-02 10:21:45

标签: apache mod-rewrite

我想从网址中删除.php扩展程序,以便像http://mysite.com/abc.php这样的网址会重定向到http://mysite.com/abc如何在apache中使用.htaccess执行此操作

1 个答案:

答案 0 :(得分:1)

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php

你可以轻松谷歌.....

相关问题