我认为在我的htaccess代码中有一些问题,但我无法弄清楚。使用Htacess删除文件夹名称
我需要的是。
1)从像www.domain.com/index代替www.domain.com/index.php
2的地址PHP扩展)卸下文件夹名称。我的网站文件存储在一个名为public的文件夹中。我想删除它。 www.domain.com/public/index.php到www.domain.com/index
我写了下面的代码,请让我知道这是什么错误。
# This will hide the folder name public and the php text
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+public/([^\s]+) [NC]
RewriteRule^%1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
# if you face any problem than try to uncomment the below line and delete the line after it
RewriteRule (?!^public/)^(.*)$ public/$1 [L,NC]
可能重复:[删除扩展名为.php与的.htaccess(http://stackoverflow.com/questions/4026021/remove-php -extension-with-htaccess) – Azrael 2014-09-24 06:42:23
1)使用'选项+多视图' – Phil 2014-09-24 06:42:52
有人可以告诉我为什么这是downvoted? – user3477550 2014-09-24 07:15:36