我在运行XAMPP堆栈的我的localhost
上有PHP项目。.htaccess在xamp中不工作
我想从所有面向用户的URL中删除.php
扩展名。
我尝试使用Apache的mod_rewrite
在.htaccess
文件:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^locations(/.*)?$ poet.php [L,NC]
</IfModule>
但它是 “不工作”。
[Remove .php extension with .htaccess]可能的重复(http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) –
@Abhishek我看到这篇文章时,我谷歌但这个步骤没有工作,所以最后我决定问问题 –
RewriteEngine叙述上 重写规则^(+)\。PHP $/$ 1 [R,L] 的RewriteCond%{REQUEST_FILENAME} .PHP -f 重写规则^(。* ?)/?$ /$1.php [NC,END] –