仅将图像重定向到静态域
Redirect only images to static domain
如何 301 将所有图像(png、jpg、gif)请求从 www.example.com 重定向到 static.example.com?
我的 htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) http://www.example.com/ [R=301,L]
有什么想法吗?
这应该可以为您完成。
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) http://www.example.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{REQUEST_URI} ^/(.+)\.(gif|png|jpg)$ [NC]
RewriteRule ^(.*)$ http://static.example.com/ [L,R=301]
告诉我它是如何为你工作的。
如何 301 将所有图像(png、jpg、gif)请求从 www.example.com 重定向到 static.example.com?
我的 htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) http://www.example.com/ [R=301,L]
有什么想法吗?
这应该可以为您完成。
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) http://www.example.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{REQUEST_URI} ^/(.+)\.(gif|png|jpg)$ [NC]
RewriteRule ^(.*)$ http://static.example.com/ [L,R=301]
告诉我它是如何为你工作的。