Пытаюсь оптимизировать запросы css и js в смоём магазине. Подскажите как правильно.
Мне нужно поддомен css1.mysite.com направить в папку mysite.com/css/.
Само собой на хосте поддомены перенаправил в корень сайта.
Вопрос в том, что нужен здесь редирект 301? типа:
RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
RewriteRule ^\/css\/(.*)$ http://css1.mysite.com/$1 [R=301,L]
Или нужно сделать чтобы запросы на mysite.com/css уходили на css1.mysite.com, но не как редирект, а чтобы так и оставался домен mysite.com/css ?
RewriteCond %{REQUEST_URI} !^ mysite.com/css
RewriteCond %{HTTP_HOST} ^/css1$ [NC]
RewriteRule ^(.*)$ /mysite.com/css/$1 [L,QSA]
Пробовал эти варианты, изменений в магазине нет.
.htaccess в корне сайта mysite.com
Информация из этого мануала
http://www.__prestashop.com/blog/en/10-best-tips-to-speed-up-your-prestashop-store-3/#comment-1899Create sub-domains for Javascript files and CSS files
Create a sub-domain js1.mystore.com and ask your hosting provider to direct it to /js/
Create a sub-domain js2.mystore.com and ask your hosting provider to direct it to /theme/mytheme/js/
Create a sub-domain css1.mystore.com and ask your hosting provider to direct it to /css/
Create a sub-domain css2.mystore.com and ask your hosting provider to direct it to /theme/mytheme/css/
These 4 sub-domains will allow your visitors to load more files at the same time. Basically, a web-browser is limited to 8 parallel downloads. Each sub-domain is adding 8 new parallel downloads, so the total would be 40 (Main domain + 4 sub-domains).