【发布时间】:2015-09-06 17:24:23
【问题描述】:
用最简单的术语来说,我试图将用户从 faq.html 重定向到 Help/Frequently-Asked-Questions。现在下面的代码部分工作。从某种意义上说,url 确实显示了干净的 url,但是找不到 faq.html 页面本身,因为干净的 url 在重写时充当了它自己的页面。
任何帮助将不胜感激。
# Activate rewrite engine
RewriteEngine On
# Establish the base
RewriteBase /
# external redirect from actual URL to pretty one
RewriteCond %{THE_REQUEST} /faq.html [NC]
RewriteRule ^ Help/Frequently-Asked-Questions [R=302,L,NE]
# internal forward from pretty URL to actual one
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^faq.html$ help/Frequently-Asked-Questions [L,QSA]
【问题讨论】:
标签: php apache .htaccess mod-rewrite url-rewriting