2015-10-15 128 views
0

在发布之前,我已经尝试了解决方案URL1URL2但尚未修复。我.htaccess这样的代码:.htaccess删除.php扩展不工作

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^([^\.]+)$ $1.php [NC,L] 

在我的应用程序$_GET和使用$_POST和文件结构htdocs这样的:

shopping ->(main folder) css(folder) images(folder) js(folder) .htaccess file1.php file2.php : : file9.php

所以,我怎么能得到从URL

去除 .php摆脱

回答

0
  1. 检查首先应用- see here;

  2. 请确保您的配置允许.htaccess文件至少FileInfo重写(你也可以这样做AllowOverride All):

    <Directory "/var/www/html"> 
        AllowOverride FileInfo 
    </Directory> 
    

    详见this question