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

[eluser]ruby42[/eluser]
Hi,

I'd like to use routes.php file to put on my website friendly url to these folders: css, images, js, etc. and I don't want to move my assets folder to the root directory - I know that I can move this folder to the root directory and add assets to .htaccess file and it will work correctly, but I would not like to change my structure.

At this moment my url is: www.mypage.com/system/application/assets/images/top.png
but I would like to have this: www.mypage.com/images/top.png

Structure of my folders is:
Code:
/root
    /system
        /application
            /assets
                /css
                /images
                /javascript
/.htaccess

My .htaccess is:
Code:
RewriteEngine On
RewriteCond $1 !^(index.php|system|robots.txt|sitemap.xml|favicon.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]


Something like this doesn't work:
Code:
$route['images/(:any)'] = 'system/application/assets/images/$1';

Thanks for helping.


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



Theme © iAndrew 2016 - Forum software by © MyBB