【发布时间】:2015-11-18 19:54:15
【问题描述】:
我可以得到帮助吗:
我在谷歌网站管理员工具上看到这样的链接断开: test.php?t=test%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/
【问题讨论】:
标签: .htaccess