1
什麼我已經是這樣的網址:的.htaccess重寫與位置哈希網址
domain.com/index.php?chapter=chapter-name
和URL鏈接此:
domain.com/index.php?marker=marker-name
我要的是:
domain.com/#chapter-name
和這個:
domain.com/#chapter-name/marker-name
我該如何使用.htaccess來做到這一點?
我現在有以下幾點:
RewriteEngine On
RewriteRule ^(.*)/$ http://%{HTTP_HOST}/$1
RewriteRule ^([a-zA-Z0-9_-]+)?$ index.php?chapter=$1
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?chapter=$1
謝謝!
'#'是一個網址片段,以這種方式使用它可能不會產生你所追求的效果:http://blog.httpwatch.com/2011/03/01/6-things-you-should- know-about-fragment-urls/ – CD001
你不能通過htaccess來完成,而是使用Javascript。 – anubhava
第二個請求實際上是:domain.com/index.php?chapter=chapter-name&marker=marker-name? –