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