S
S
sgrogov2014-07-09 13:00:58
Apache HTTP Server
sgrogov, 2014-07-09 13:00:58

Why doesn't htaccess process css files?

The structure of the system is as follows:
/site
index.php
/sites
many html, css, js, png, jpg and other files
What lies in sites is a static copy of the site. The /site/index.php file opens one of the pages located in /sites, simultaneously replacing all links in it from original-site.ru/(.*) to /sites/$1. At the root there is .htaccess with the following content:

RewriteEngine On
RewriteRule ^sites/(.*\.(html|css))$ /site/?url=$1 [R]

As a result, when accessing the address
/sites/index.html , we
go to the address
/site/?url=index.html,
and at the address
/sites/styles.css
we stay there.
Google only said usefully:
"To speed up the work of sites, they (css-files) are processed bypassing the main web server and without analyzing .htaccess files.",
but did not answer where this can be configured.
Is the idea with Google's answer correct, if so, where can I fix it, if not, then what is the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg Krasnov, 2014-07-09
@OKrasnov

This rule works for me both on .html and .css.
Perhaps the problem is not in .htaccess, but in the /site/index.php file.

A
Andrey Burov, 2014-07-09
@BuriK666

Perhaps the server has nginx, which gives static files directly, without the participation of apache.

S
sgrogov, 2014-07-09
@sgrogov

Nginx caches static files and they are not processed by apache.
It is worth reconfiguring nginx, excluding the necessary folders, but in my case of lack of access to the server settings, I will have to solve it by changing the application logic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question