问题原文
原帖链接 · Ashkan · CC BY-SA 3.0
I'm trying to redirect this url:
www.example.com/path/index.php?user=username&option=optname
to
username.example.com/path/optname.html
I tried several ways but I'm getting errors. How to do that?
已采纳解答
原帖链接 · DwillX · CC BY-SA 3.0
Here's the sample rewrite commands you should be looking for:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
