Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Disabled Url extension
  • Is there a reason why Fuel disable Url's like this http://example.com/user/fname.lname.id

    More like: (routes.php)
    return array(
        'user/([\w\-]+\.[\w\-]+\.[\d]+)' => 'Profile/index/$1',
    );
    does not capture the last \d
  • Everything after the last dot is considered to be an extension, which is stripped by default.

    In the config, you can set routing.strip_extension to false to disable this globally. Alternatively, you can make routing.strip_extension an array of extensions you want to strip.

    See http://docs.fuelphp.com/general/configuration.html
  • Okay, but does this "extension" have any security issue? to cause the removal in fuel
  • No,

    the extension can be used if you have (rest) controllers supporting multiple response formats, so something like /users/get.xml can return a userslist in XML format, while /users/get.json will return the same data in json format.

    the extension can also be used to "hide" the platform, for example by giving all URL's in your app an ".aspx" extension, which Fuel can strip and ignore.

    If your app doesn't ulitize extensions, you can safely disable the stripping. You might have to look at routes, like you have noticed, because they can behave differently, whether or not your URL has an extension.

Howdy, Stranger!

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

In this Discussion