我是htaccess的新手,但我想这样做
例如,我想转发:
www.abc.com/page_1.html
www.abc.com/folder123/page_a.html
www.abc.com/folder123/page_b.html
为:
subdomain.abc.com/page_1
subdomain.abc.com/folder123/page_a
subdomain.abc.com/folder123/page_b
注意:abc.com(HTML)和subdomain.abc.com(在Wordpress上)位于不同的Web服务器上。
谢谢!
答案 0 :(得分:1)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.abc\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/www\.subdomain.abc\.com\/" [R=301,L]