0
我做了靜態內容的一個子域(static.site.com),我有以下的.htaccess:的.htaccess重複的靜態內容加載
RewriteCond %{HTTP_HOST} www.site.com [NC]
RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|css|js|txt|ico|pdf)$ [NC]
RewriteRule ^(.*) http://www.static.site.com/$1 [L,R=301]
一切都加載罰款,但在Firebug我有兩行與rewrited的每個文件:
http://www.site.com/images/image.png (301 Moved Permanently)
和
http://www.static.site.com/images/image.png (304 Not Modified)
如何防止加載我的主要網域內容。謝謝。
我只是想重寫所有內容的路徑而不顯示301螢火蟲重定向。 – overgapo
@andrew使用子域而不是主域。否則會發送301狀態碼! – undone
這就是我想要做的。我想自動更改從主域到子域的所有靜態內容路徑。 – overgapo