尝试重定向:
domain.com/search/?q=query&p=2
domain.com/niche/?q=weddings&p=2
domain.com/tag/?q=rings&p=2
到
domain.com/index.php?search=query&page=2
domain.com/index.php?group_name=weddings&page=2
domain.com/index.php?tag=rings&page=2
不更改网址。
使用此规则:
RewriteCond %{QUERY_STRING} ^q=([^/]+)&p=([0-9]+)$
RewriteRule ^search/$ index.php?search=%1&page=%2 [L]
RewriteCond %{QUERY_STRING} ^q=([^/]+)&p=([0-9]+)$
RewriteRule ^niches/$ index.php?group_name=%1&page=%2 [L]
RewriteCond %{QUERY_STRING} ^q=([^/]+)&p=([0-9]+)$
RewriteRule ^tag/$ index.php?tag=%1&page=%2 [L]
搜索和利基工作正常,而Tag正在提供404.但是,sraight网址(如domain.com/index.php?tag=rings&page=2)效果很好。你能帮我搞清楚吗?谢谢!