Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite: a , instead of a? and lenght of URL or filename

         

knorri

1:52 pm on Dec 8, 2003 (gmt 0)

10+ Year Member



We have a script with many parameters, added to the URL by a question mark '?':

www.foo.com/script.pl?param1=a&param2=b&param3=c...

For search engine reasons, we call the script with a comma instead of the question mark, making the parameters part of the file name (www.foo.com/script.pl,param1=a&param2=b&param3=c...
). We use mod_rewrite to swap the , with a? on the server side.

Problem: Apache responds a 403 forbidden error! When calling the url with a comma added parameter list. There are no restrictions on that directory.

Could it be that Apache has a problem with a much to long filename? When using the comma adding the parameters, the file name gets close to (or more than) 255 characters.

Thanks,

Markus

jdMorgan

8:01 pm on Dec 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Markus,

No, the problem is that a comma is not a valid character in the path component of a URL -- See RFC2396 [faqs.org], sections 3.3 and 3.4.

Also, the "?" is required to demarcate the beginning of a query component.

You might want to read some of the other threads here on rewriting static to dynamic URLs.

I'd suggest you rewrite something like www.foo.com/script/a/b/c to www.foo.com/script.pl?param1=a&param2=b&param3=c...

This makes the URL search-engine-friendly and shorter, and avoids the use of reserved characters in the URL path component.

Jim

knorri

8:45 am on Dec 9, 2003 (gmt 0)

10+ Year Member



Jim,

thanks a million!

Markus