我的錨是這樣重定向和用mod_rewrite
<a href="http://localhost/haveg/employer?id=7003&title=the-message-title">employer</a>
,當我點擊錨我想在這裏達到
http://localhost/haveg/employer/7003/the-message-title
到目前爲止,我已經寫了這個.htacess代碼
Options +FollowSymLinks
Options +Indexes
RewriteEngine on
RewriteBase/
RewriteRule ^haveg/employer/([0-9]+)/?(.*) haveg/employer.php?id=$1
,只有當我鍵入http://localhost/haveg/employer/7003/the-message-title
,但我想在這裏到達後,我點擊打開的頁面錨點。
謝謝。
這很好用。 – shaikh 2012-01-31 07:10:34
我不太明白。該代碼不起作用,然後他告訴你改變鏈接,所以你不需要重寫? – Tiggerito 2012-01-31 18:40:18
該鏈接需要匹配URI,這是他必須更改其錨點的原因。重寫的作品,不知道你爲什麼說它不 – Jeremy 2012-01-31 18:48:44