Welcome Guest, Not a member yet? Register   Sign In
Using :any route breaks css/images
#1

[eluser]samwilliamh[/eluser]
Hi,

I'm developing a CMS based on CodeIgniter for a client and the one thing they specifically wanted was the ability to add pages themselves, something which I have not done with CI before. I read through a bunch of topics and the user guide and added a route to routes.php:

Code:
$route['home/:any'] = "home/index";

The index function in the home controller then loads the layout and the page content. However, the css and images (along with css images) do not work on most pages. For example, they work on:

localhost/fhs/home

but not on:

localhost/fhs/home/test

and all pages like the above. The css and images are both located here:

localhost/fhs/css
localhost/fhs/images

In the /home page they load fine with the above URLs but with any page with a segment in the URL after /home/ it tried to load the css and images from:

localhost/fhs/home/css
localhost/fhs/home/images

Is there another route I can add to fix this or a htaccess rule? I've had a go at it but can't seem to fix it. Any help is greatly appreciated.


Messages In This Thread
Using :any route breaks css/images - by El Forum - 09-10-2009, 09:50 AM
Using :any route breaks css/images - by El Forum - 09-10-2009, 10:01 AM
Using :any route breaks css/images - by El Forum - 09-10-2009, 10:02 AM
Using :any route breaks css/images - by El Forum - 09-10-2009, 10:04 AM
Using :any route breaks css/images - by El Forum - 09-10-2009, 10:14 AM
Using :any route breaks css/images - by El Forum - 09-10-2009, 06:24 PM
Using :any route breaks css/images - by El Forum - 09-10-2009, 06:45 PM
Using :any route breaks css/images - by El Forum - 09-11-2009, 05:23 AM
Using :any route breaks css/images - by El Forum - 09-11-2009, 05:41 AM
Using :any route breaks css/images - by El Forum - 09-11-2009, 05:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB