php - using .htaccess to modify asset paths base on domain (multiple sites on one symfony app) -
I'm making a Symphony app created to run many sites like it.
So far it is so good that he uses some .htaccess "voodoo". To get this image, it is possible to get the CSS file link redistributed to indicate the property directory in the name of the current domain. Again read the article above, if he does not understand.
The line from this article is:
rewrite / home / ash / projects / carshops / trunk / web / perhost /% {HTTP_HOST}% {REQUEST_FILENAME} -f rewrite Rule (. *) / Replace /% {HTTP_HOST} / $ 1 [L]
Here is the only line optimized for me Windows Test Server:
Rewrite C: / xampp / projects / listing / web / sites /% {HTTP_HOST}% {REQUEST_FILENAME} -f rewrite rule (. *) / Sites /% {HTTP_HOST} / $ 1 [L]
Is there something wrong with my syntax or I do not understand It has to do .htaccess code. I have checked and mod_rewrite is running.
What I am trying to do is to make it so I do not have to ask the database (to recover the current website) to get the correct path for the files. Each domain has its own images, CSS, files in its own directory, which are then designated
like this
- Web / Site / Website 1 / {Images, JS, CSS}
- Web / Site / Website 2. com / {Picture, JS, CSS}
Let me know if you need more information.
Thank you!
There is already a full file system path:
REQUEST_FILENAME < Br> The full local filesystem path for the file or script matching the request.
But why do not you use $ 1
in the condition, as it is also the destination you want to redirect:
RewriteCond / home / ash / projects / carshop / trunk / web / perhost /% {HTTP_HOST} / $ 1 -f rewrite rule (. *) / Perhost /% {HTTP_HOST} / $ 1 [L]
Comments
Post a Comment