如果您只想重定向http://www.mydomain.com/en/wfmenuconfig/family/family-disease/177-category-english?start=$var
到http://www.mydomain.com/en/family-members/family-disease
,那么您必须尝试以下指令:
# once per .htaccess file
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} start=([0-9]*)
RewriteRule ^en/wfmenuconfig/family/family-disease/177-category-english /en/family-members/family-disease [R=301,L]
但如果这不是你想要的,而是重定向http://www.mydomain.com/en/wfmenuconfig/family/family-disease/177-category-english?start=$var
到,http://www.mydomain.com/en/family-members/family-disease$var
那么你可以检查这个:
# once per .htaccess file
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} start=([0-9]*)
RewriteRule ^en/wfmenuconfig/family/family-disease/177-category-english /en/family-members/family-disease%1 [R=301,L]
现在,如果它可以工作,请再试一试。如果不是,请找出任何可疑的为什么此代码不起作用:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /en/
RewriteCond %{QUERY_STRING} start=([0-9]*)
RewriteRule ^wfmenuconfig/family/family-disease/177-category-english /family-members/family-disease [R]
如果http://www.mydomain.com/en/wfmenuconfig/family/family-disease/177-category-english?start=$AnyNumber
它正在重定向http://www.mydomain.com/en/family-members/family-disease
,请确保您的网络服务器具有mod_rewrite。