【发布时间】:2016-01-24 11:11:18
【问题描述】:
我的网站启用了删除 /index.php?q= 的用户友好 URL,但是在 Google 中我发现许多没有意义的 URL,例如:
/category/Trees/index.php?q=/item/view/11527
唯一相关的部分是
如何使用 htaccess 将这些永久重定向到 /item/view/11527 URL?
目前我有这个:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?q=$1&%{QUERY_STRING} [L]
【问题讨论】:
标签: regex apache .htaccess mod-rewrite friendly-url