Welcome Guest, Not a member yet? Register   Sign In
URI Troubles
#1

[eluser]stuffradio[/eluser]
For some reason, I get a lot of this message
Quote:The URI you submitted has disallowed characters.

and sometimes this message

Quote:Message: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 19

The url is http://localhost/urls/register

htaccess file is

Code:
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

index page is blank

Allowed characters:
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

Routes
Code:
$route['default_controller'] = "followurl";
$route['followurl'] = "followurl";
$route['settings'] = "settings";
$route['urls'] = "urls";
$route['user'] = "user";
$route['scaffolding_trigger'] = "";
$route[':any'] = 'urls/getpage/$1';

What I want is, anytime I don't have any of those controllers in the routes page, it should redirect using the :any route. This is for a short url script I'm doing.
#2

[eluser]xwero[/eluser]
you have a question mark in the last line of your .htaccess
#3

[eluser]stuffradio[/eluser]
That fixed some of the problem (I copied and pasted that htaccess file)

The URL that I listed above still has the same problem though. Any thoughts?
#4

[eluser]xwero[/eluser]
your any route is not fetched so $1 will not be undefined. you need to add parenthesis.
#5

[eluser]stuffradio[/eluser]
Can you show me?
#6

[eluser]xwero[/eluser]
(:any)
#7

[eluser]stuffradio[/eluser]
When I have this line uncommented
Code:
$route['(:any)'] = 'urls/getpage/$1';
It gives me the error message

Quote:The URI you submitted has disallowed characters.

When it's commented,all the pages except for the short url page works. So do you have any ideas how I can fix this?
#8

[eluser]Mike Ryan[/eluser]
Hi,

Change the single quotes to double quotes:
Code:
$route['(:any)'] = "urls/getpage/$1";

If you use single quotes the variables are not interpolated, so you are requesting a page called $1, instead of the value of the $1 variable.
#9

[eluser]stuffradio[/eluser]
No dice, it still gives me the annoying error.
#10

[eluser]stuffradio[/eluser]
So can anyone give me pointers on htaccess files that would work for all servers and how to setup my routes to work the way I want them to?




Theme © iAndrew 2016 - Forum software by © MyBB