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