Url encoded forward slash in MVC or codeignitor app urls

When using PATH_INFO , the urls of codeignitor apps or your custom MVC looks like this

index.php/controlller/method/param1/param2
or
/controlller/method/param1/param2

Now if the parameters contain a forward slash then you would urlencode it as :

index.php/controlller/method/par%2Fam1/param2

But opening that kind of URL would give an error : Page Not Found

This happens if AllowEncodedSlashes directive of Apache is not turned on. More Here. This directive should be turned on to allow those sort of Urls. And for codeignitor $config['permitted_uri_chars'] should also be checked to allow forward slash in uri characters.

Reference :
1. Apache Documentation







Last Updated On : 23rd June 2010

Subscribe to get updates delivered to your inbox

Leave a comment