odd relative path behaviour |
[eluser]neomech[/eluser]
Hi, I'm fairly new to CI but I'm loving it and have built most of my app without too much trouble. I've run across something odd, and I'm not sure if it's a bug or if I'm just missing something obvious, so I thought I'd post here for help (let me know if there's somewhere better to post!) I have the following bit of code in my routes.php file: Code: $route['(:any)-reviews'] = "category/parent/$1-reviews"; Now, I was messing with adding some additional information to my url (say, the number of movie reviews to return), and it works, but all of my image paths in my view go wonky. So if I do something really basic like add this route (I'd normally use variables, but I'll just hardcode "shortlist" and "25" to show what I mean): Code: $route['(:any)-reviews/short_list'] = "category/parent/$1-reviews/25"; ...everything works, I can add a second input to my controller that properly takes the "25", but all of my images fail, because now they all point to "http://www.mysite.com/movie-reviews/images/image1.gif". Any idea what's happening here? I'd expect this behaviour maybe if I was using ../image/image1.gif, but if I'm using image/image1.gif, I expect it to be relative to the website's base url (if that makes sense). I like relative paths and know I could make use of base_url() variables and such, but was just wondering why this was happening instead of just throwing my hands up in the air and doing it differently. |
Messages In This Thread |
odd relative path behaviour - by El Forum - 09-04-2009, 07:10 PM
odd relative path behaviour - by El Forum - 09-04-2009, 07:24 PM
odd relative path behaviour - by El Forum - 09-04-2009, 07:54 PM
odd relative path behaviour - by El Forum - 09-04-2009, 08:48 PM
odd relative path behaviour - by El Forum - 09-05-2009, 04:15 AM
|