1

我在整个站点中使用 htaccess mod rewrite 从页面中删除斜杠和 .php 扩展名。

但是,当我来到目录和页面 work/index.php 时,我在这里遇到了麻烦:http: //thriftandthistle.co.uk/sprout/work/

我想完全删除 index.php,但由于使用哈希来过滤投资组合,我遇到了问题。

但是使用 htaccess 我希望 php 页面读取 work#print 等来过滤投资组合,但这些只是导致页面通过 mod 重写重定向。

这是我的htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
# remove trailing slash
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
# Replace html with your file extension, eg: php, htm, asp

php_value include_path 'includes'

任何人都可以帮助建议我可以对 htaccess 进行更改以删除尾部斜杠并停止哈希重定向页面而不是过滤投资组合吗?

我让它在像这里这样的 html 页面上工作:http: //thriftandthistle.co.uk/sprout/work.html 但不是重写,这似乎导致了问题。

4

0 回答 0