Useful .htaccess file for images/css/js rerouting. |
[eluser]MPress[/eluser]
Just in case this might be useful for someone else: I modified the recommended .htaccess file from the user guide to the following: Code: RewriteEngine on now all requests to {domain}/images/ {domain}/css/ {domain}/js/ are routed internally to {domain}/system/application/views/images/ {domain}/system/application/views/css/ {domain}/system/application/views/js/ respectively. I was originally thinking it would be better to route js requests to a subdir of controllers but took the views "route" if only for consistency. This needs additional filtering because currently you cannot access a controller named 'system' without first prefixing it with index.php/. I don't know jack about regular expressions so any help in this regard would be much appreciated.
[eluser]alin4lex[/eluser]
hello, how sould i do to route: ./themes/theme1/css ./themes/theme1/images ./themes/theme1/scripts to: system/application/views/theme1/css system/application/views/theme1/images system/application/views/theme1/scripts thanks!
[eluser]MPress[/eluser]
[quote author="alin4lex" date="1191157400"]hello, how sould i do to route: ./themes/theme1/css ./themes/theme1/images ./themes/theme1/scripts to: system/application/views/theme1/css system/application/views/theme1/images system/application/views/theme1/scripts thanks![/quote] This should work: Code: RewriteRule ^themes/theme1/(css|images|scripts)/(.*) /system/application/views/theme1/$1/$2 [L] Or, for multiple theme rerouting, you can do the following: Code: RewriteRule ^themes/(theme1|theme2)/(css|images|scripts)/(.*) /system/application/views/$1/$2/$3 [L]
[eluser]alin4lex[/eluser]
thanks, but i did it this way : http://ellislab.com/forums/viewthread/61856/ |
Welcome Guest, Not a member yet? Register Sign In |