Welcome Guest, Not a member yet? Register   Sign In
friendly url to css, images, js and etc. folders using routes.php ?
#5

[eluser]ruby42[/eluser]
I thought that I was able to use routing from CI like it works in htaccess file = request will not be sending to controller, but it will just rewrite my rule. Now I see that routing in CI is useful when I'm sending something to controller (and I want to use this dynamically) as for example:

Code:
$route['([a-zA-Z]{2})/([a-zA-Z0-9-]+)/([0-9]+)-([0-9]+)-([a-zA-Z0-9-]*)'] = 'ads/ads_show_subcategory/$3/$4';

So, I will try to use htaccess file to rewrite my rule, because it works before request is sending to CI - what do you think about this? Will it work correctly?

my .htaccess looks like:
Code:
RewriteEngine On

RewriteRule ^assets/ads-images/([^/]*)$ /system/application/assets/ads-images/$1 [L]
RewriteRule ^assets/banners/([^/]*)$ /system/application/assets/banners/$1 [L]
RewriteRule ^assets/css/([^/]*)$ /system/application/assets/css/$1 [L]
RewriteRule ^assets/flash/([^/]*)$ /system/application/assets/flash/$1 [L]
RewriteRule ^assets/images/([^/]*)$ /system/application/assets/images/$1 [L]
RewriteRule ^assets/javascript/([^/]*)$ /system/application/assets/javascript/$1 [L]
RewriteRule ^assets/scripts/([^/]*)$ /system/application/assets/scripts/$1 [L]
RewriteRule ^assets/site-images/([^/]*)$ /system/application/assets/site-images/$1 [L]

RewriteCond $1 !^(index.php|system|robots.txt|sitemap.xml|sitemap.xml.gz|sitemap_pl.xml|sitemap_pl.xml.gz|sitemap_ru.xml|sitemap_ru.xml.gz|sitemap_en.xml|sitemap_en.xml.gz|sitemap_es.xml|sitemap_es.xml.gz|favicon.ico|websites|prolink.php|prolink_config.php|prolink_9e1483f6d0ba91ece177d147bd77511f.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]


Messages In This Thread
friendly url to css, images, js and etc. folders using routes.php ? - by El Forum - 09-26-2012, 10:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB