Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Routing Full URL's and double slashes
  • So i'm trying to do something like if a user click on a URL, it routes it to one of my Controllers first, and I increment the count on that URL. so in my routes.php i included something like this
    'golater/clicklink/(:url)' => 'golater/clicklink' then if the link looks something like this
    http://192.168.2.7/fuel/index.php/golater/clicklink/http://www.hello.com
    something is stripping out my double slash in the 'http://'
    so my url parameter becomes http:/www.hello.com
    I browsed through the source code, and couldn't find a place where it's stripping out slashes (unless i just missed it, hard thing to find)
    Is this somewhere in FuelPHP? (if so which file?)
    or is this on another level... i.e. my linux server configuration or something like a mod rewrite? (i used the default oil installation)
  • That is an illegal URL, so you should encode it. This way, the slash will be seen as a directory/path separator, so FuelPHP will split it. The double slash itself is already stripped by apache. Just var_dump($_SERVER) to see that:
    'PATH_INFO' => string '/welcome/index/http:/www.bla.com' (length=32)
    
  • Thanks again wan wizard. I should have guessed it was something outside of fuel, was too linearly focused

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion