【发布时间】:2017-09-08 07:24:12
【问题描述】:
我想通过 httpd.conf 中启用的 RewriteRule (mod_rewrite) 重定向我的 URL:
https://mysite.domain.tld/index_php_file.php?ab=ident_keys&ac=5GU7VBNAH45DA5
到:
https://mysite.domain.tld/index_php_file.php?ab=ident_key_1024&ac=5GU7VBNAH45DA5
我已经尝试了许多规则但没有运气:
RewriteCond %{HTTP_HOST} hmysite.domain.tld
RewriteRule ^/index_php_file\.php\?ab=ident_keys&ac=$ https://hmysite.domain.tld/index_php_file.php?ab=ident_key_1024&ac= [R=301,L,QSA]
也没有
RewriteCond %{QUERY_STRING} ^ac=(.*)$
RewriteRule ^/?([a-z-0-9-_.]+)$ /$1/index_php_file.php?ab=ident_key_1024&ac=%1 [L,R=301]
似乎要重写网址。
对我所缺少的有什么建议吗?
非常感谢。
【问题讨论】:
标签: mod-rewrite httpd.conf apache2.4