0
我可以得到這個幫助:創建htaccess的一個固定鏈接
我在谷歌網站管理員工具看斷開鏈接是這樣的: test.php的T =測試%20title
test.php的頁面刪除,現在我用index.php而不是test.php
所以我需要用htaccess重新編寫url。我怎樣才能做到這一點?
http://www.domain.com/test.php?t=test%20title 鏈接改變 http://www.domain.com/t/test-title/ 或 http://www.domain.com/index.php?t=test%20title
我也嘗試這些選項但不工作的:
ReWriteRule ^test.php?t=(.*)$ index.php?t=$1
ReWriteRule ^test.php?t=([0-9a-z]+)$ index.php?t=$1
ReWriteRule ^test\.php\?t=(.*)$ index.php?t=$1
ReWriteRule ^test\.php\?t=([0-9a-z]+)$ index.php?t=$1
有可能創建永久使用htaccess的這個? http://www.domain.com/t/test-title/
感謝您的回覆,我很抱歉我遲到的答覆。我現在嘗試了,但url更改爲這樣:http://www.domainname.com/home/hostusername/public_html/t/test-title-HTTP/1.1我該怎麼做? http://www.domainname.com/t/test-title – webmaster
@Webmaster我編輯了這個答案,問題是重寫目標中的相對路徑,我已將其更改爲絕對路徑。 – starkeen
謝謝你的回答。現在url像這樣變化:http://www.domainname.com/t/test-title-HTTP/1.1如何從url中移除-HTTP/1.1?我需要這樣的:http://www.domainname.com/t/test-title/ – webmaster