Welcome Guest, Not a member yet? Register   Sign In
$config['permitted_uri_chars'] doesn't work properly
#1

[eluser]asim111[/eluser]
I just installed Codeigniter 2.1.0

I want to allow just few characters in URLs. By default only these are allowed: a-z 0-9~%.:_-

I'm having some problems with $config['permitted_uri_chars'] as it is not working properly for me for some reasons.

I used few characters in URL for testing purposes such as single quote, double quote, £ pound sign. I can't see any restriction on these characters or there is NO ERROR message like
Quote:"The URI you submitted has disallowed characters."

My test URL was:
Code:
http://localhost/codeigniter/index.php/welcome/index/abc£1/

And on the other hand, I tried percentage sign % which is allowed in URLs and got the following error message
Code:
400 Bad Request: Your browser sent a request that this server could not understand.

Am i doing something wrong? please help
Thanks
#2

[eluser]tommymcglynn[/eluser]
I am having the same issue. Any solutions?
#3

[eluser]CroNiX[/eluser]
They still have to be valid uri encoded characters. Just because you add something to the permitted characters doesn't make it a valid to be in the url, if it goes against the standards.
#4

[eluser]parvus[/eluser]
Code:
# Options
Options -Multiviews
Options +FollowSymLinks
AddDefaultCharset UTF-8
#Enable mod rewrite
RewriteEngine On
#the location of the root of your site
#if writing for subdirectories, you would enter /subdirectory
RewriteBase /yourdirectory/

#Removes access to CodeIgniter system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#This last condition enables access to the images and css
#folders, and the robots.txt file
RewriteCond $1 !^(index\.php|(.*)\.swf|(.*)\.jpg|(.*)\.txt|images|robots|css|docs|cache)
RewriteRule ^(.*)$ index.php?query=$1 [L]
RewriteRule ^(.*\.(html))$ $1
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]




Theme © iAndrew 2016 - Forum software by © MyBB