这是我的简单 htaccess,它将所有调用重定向到 index.php 或 error.php
它工作正常,但我会从地址栏中隐藏原始地址。
#Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php [L]
ErrorDocument 404 /error.php
现在,如果我继续访问 www.mysite.com/news/last,我可以查看 www.mysite.com/index.php?p=news§ion=last,但我希望地址栏中没有更改。
提前致谢 ;)