how to rewrite urls for images and other static files to specific folder, i.e. I am using this so far:
RewriteRule \.(woff|ttf|svg|js|ico|gif|jpg|png|css|htc|xml|txt)$ /MyFolder/$1
but its not working,
please help.
——————- update ———————
ok so now I have:
RewriteCond %{HTTP_HOST} ^(www.)?exmpale.com$
RewriteCond %{REQUEST_URI} !^/exmpale.com/
RewriteRule ^(.*\.(woff|ttf|svg|js|ico|gif|jpg|png|css|htc|xml|txt))$ /exmpale.com/$1
RewriteCond %{HTTP_HOST} ^(www.)?exmpale.com$
RewriteRule !\.(woff|ttf|svg|js|ico|gif|jpg|png|css|htc|xml|txt)$ /exmpale.com/index.php
so images redirected to exmpale folders work but now I would like to rewrite everything else to index.php, above solution is not working so far.
cheers,
/Marcin
Maybe this is what you want:
or perhaps this:
If neither of those is what you’re looking for please add details with some examples of your desired inputs/outputs.
As for your update, you probably want to use the
Lflag to stop rule processing when this rule matches. eg: