Answer the question
In order to leave comments, you need to log in
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]
Answer the question
In order to leave comments, you need to log in
This rule works for me both on .html and .css.
Perhaps the problem is not in .htaccess, but in the /site/index.php file.
Perhaps the server has nginx, which gives static files directly, without the participation of apache.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question