Mod Rewrite Fails with Encoded Urls Containing & ” #. Help…

60 pts.
Tags:
Apache
CGI
Mod ReWrite
Perl
URL Encoding
I am using mod rewite quite successfully but I have a user who keeps using illegal characters and it breaks my program. It seems that either the & or the # may throw things off. I am in desperate need of some help. I'd rather not have to stop the users from being able to use chars in their data.

here is my raw data that I query from the database: (I parse all " as ' before they get inserted as new data) 378 36' flattop sleeper I encode that, so my url looks like: m/peterbilt/378+36%26%2334%3b+flattop+sleeper/100 When I click the link it hits the URL rewrite rule: RewriteRule ^m/([^/>+)/([^/>+)/([^/>+)/?$ /index.cgi?make=$1&model=$2&stock=$3 [L] This is what I am expecting to get when I dumo %FORM (key+pair): *I need to run a query back to the DB WHERE model='378 36' flattop sleeper'  $FORM{make}="peterbilt"; $FORM{model}="378 36' flattop sleeper";   (' = %26%2334%3b encoded) $FORM{stock}=100; but this is what I get: $FORM{make}="peterbilt"; $FORM{model}="378 36"; It stops processing as soon as it hits the &. I tried RewriteRule ^m/([^/>+)/([^/>+)/([^/>+)/?$ /index.cgi?make=$1&model=$2&stock=$3 [NE,L]   Which doesn't work. I don't want to change the order to put model at the end because no matter what data I have it should not error like this.

I could potentially pase before it goes out and when the data comes in but I need to know exactly what characters wil cause this problem or if there is a work around.



Software/Hardware used:
Linux Enterprise, Apache, PERL, cgi

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following