Too long url make an error "Forbidden".

Oh, the strange things mod_rewrite does!

Too long url make an error "Forbidden".

Postby softtoy » Mon Jul 03, 2006 6:46 am

Too long url make an error "Forbidden"?

Whole address line looks like this:
1) "http://host.com/h34qoth394tq9h46th9asylvnw9tg9" all that mess after "http://host.com/" is a variable(encrypted mess).

This address line can be used without mod_rewrite like this:
2) "http://host.com/index.php?variable=h34qoth394tq9h46th9asylvnw9tg9"

When this variable in section 1) is something about ~300 chars it gives error "Forbidden". Example 2) works fine even with 1000000 char variable! Is there any way to 'fix' this? :o

And rewrite rule:
RewriteRule ^([a-zA-Z0-9]+)$ /index.php?variable=$1
softtoy
 
Posts: 26
Joined: Mon Jun 12, 2006 9:45 pm

Postby richardk » Mon Jul 03, 2006 8:17 am

I doubt it. It's probably limited because files and directories can't have names that long (max on my windows XP is files 217, dirs 205), so normally it doesn't need to be very long and will stop any possible attacks.

Query strings however have no limit (http://www.html.com/forums/16632-post2.html). But wouldn't it be better to save the data to files on the server, and give the user a short ID?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

ya

Postby softtoy » Thu Jul 06, 2006 1:46 am

give the user a short ID


Yes, but sometimes it's just easier with a url. Well I must use this "/?" instead of this "/" if the length is needed ^^
softtoy
 
Posts: 26
Joined: Mon Jun 12, 2006 9:45 pm


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 2 guests

cron