Answer the question
In order to leave comments, you need to log in
Is it possible to "spread" requests for the same file via mod_rewrite?
Hey habr!
Permanent laziness affects the New Year holidays, I can not solve the problem through mod_rewrite.
At the moment, there is a temporary solution, but not a killable share of perfectionism, but partly of shame protests and asks to find a LITERAL one.
There is a new site /site/ , there is an old site /site/old/ .
The templates of the old site are laid out in such a way that all statics are requested from the root. In fact, it’s impossible to edit anything (although if I press it, I’ll write a parser).
Thus, a rule is needed that all requests from
site/old/ to /site/style.css would redirect to /site/old/style.css
While I made a rule for the root .htaccess
RewriteRule ^(.*)\.(css|js|jpg|png|gif)$ old/$0
(the root directory is still empty and suffers such mockery).
However, the static is now served from a different directory.
As far as I understand, any rules from /site/old/.htaccess to /site/ will be ignored. Or not?
How can I catch a request to /site/style.css from /site/old/ and ignore the request for statics from root?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question