apache - htaccess doesn't load new js/css from another vhost -



apache - htaccess doesn't load new js/css from another vhost -

ok, here is! have 2 virtual hosts, named main.aaa.com , static.aaa.com.

i have htaccess rule in main.aaa.com each path contains js|css|img|ico load them static.aaa.com.

this htaccess main.aaa.com:

options +indexes options -multiviews options +followsymlinks # turn on rewriteengine rewritebase / rewriteengine on # # rules # rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule !\.(css|js|ico|img)$ index.html [pt,l] rewriterule ^(.+\.(css|js|img|ico))$ http://static.aaa.com/$1 [l]

what's going on works perfectly, absolutely perfect, but... if create new file in static/js folder , seek load in main.aaa.com index file, gives 200 ok, file not changed, , looking it seems htaccess doesn't bother file in static vhost.

i have changed file permissions 755, of files have same permissions , same owner, new ones create not loaded.

any help much appreciated! give thanks you!

[edit]: tried rename file correctly loaded, because thought missing file permissions. stopped working. renamed previous name , loads. so, thinking, there history of files or can clear? @ point break something, anything! using ubuntu 14.04 lts , apache 2.4 if helps.

i have found solution problem, don't understand why works, hope not introduce other problems when force files hosting. here is, if stupid me :), have changed , moved line:

rewriterule ^(.+\.(css|js|img|ico))$ http://static.aaa.com/$1 [l]

above line

rewriterule !\.(css|js|ico|img)$ index.html [pt,l]

the final result beingness one:

rewriterule ^(.+\.(css|js|img|ico))$ http://static.aaa.com/$1 [r,l] rewriterule !\.(css|js|ico|img)$ index.html [pt,l]

good luck!

edit: maybe reply redirects, r flag, must written first. maybe.

apache .htaccess mod-rewrite

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -