0
我有一個聚合物站點,我需要編寫一個重寫規則。命名錨的Apache重寫規則
目前有example.com/index.html#contact
,example.com/index.html#FAQ
等。它的工作原理默認情況下,在瀏覽器中example.com/#contact
,example.com/#FAQ
,...
我想這是因爲example.com/contact
,example.com/FAQ
訪問,...
我:
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.html#$1 [NE]
然而,當我將R
標誌添加到它「工作」的最後一行。不幸的是,與R
標誌的地址變得可見在瀏覽器中作爲example.com/index.html#home
,我不希望這一點。
有什麼建議嗎?
謝謝,這很有趣。事實上,我以後可能會需要它。現在,我只是想在服務器上將/ foo內部重定向到index.html#foo。 –