Friday, March 9, 2012

Ampersands in URLs with CakePHP and Apache mod_rewrite

Hi all,

I'm experiencing problems when using ampersands in named parameters (Cake 1.3) which is a well known mod_rewrite problem.


Apache rewrites it to:

webroot/index.php?search:this&that

That means it's not parsed correctly by CakePHP, as the ampersand in the URL treats the query string as separate name / value pairs.

I don't want to double escape the ampersand as this results in ugly URLs.

Apache introduced a B flag to rewrite rules in version 2.2.7 which solves the problem but it's shared hosting and they won't upgrade to that.  I also tried the NE (no escape) rule but that didn't seem to make any difference.

Anyone experienced the same problem and found a good solution?

Thanks,

Alex

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate