如何重写
(anything).example.com/(anything)
至example.com/(anything)
例如:
img1.example.com/test1.jpg
至example.com/test1.jpg
img105.example.com/anotherimage.png
至example.com/anotherimage.png
tdr.example.com/a.css
至example.com/a.css
答案 0 :(得分:0)
RewriteCond %{HTTP_HOST} ^(.*)\.example.com$
RewriteCond %{HTTP_HOST} !^www\.example.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]