.htaccess使用位置哈希重写网址

What I have is a url like this:

domain.com/index.php?chapter=chapter-name

and a url link this:

domain.com/index.php?marker=marker-name

What I want is:

domain.com/#chapter-name

and this:

domain.com/#chapter-name/marker-name

How can I do this with .htaccess?

I now have the following:

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

Thanks!

To get the chapter working, try this rule:

RewriteRule ^index.php\?chapter=([a-zA-Z0-9_-]+)$ http://www.%{HTTP_HOST}/#$1

Your second needs is a arbitrary... how does the marker "know" which chapter... Maybe you meant this on your second request:

domain.com/index.php?chapter=chapter-name&marker=marker-name

You can't. Basically # is a client thing, and never sent to the server. .htaccess therefore will not work.