By Date: <-- -->
By Thread: <-- -->

[Bug 5183] titles in short urls: question mark not supported



Please do not reply directly to this message. All additional comments should
be made in the comments box of this bug report.

http://bugs.xaraya.com/show_bug.cgi?id=5183





------- Additional Comments From curtis (at) farnham.com  2006-02-10 22:43 GMT -------
Okay, I've Googled on this topic and yes, it is a "feature" of mod_rewrite.  It  
seems to have always been there, or at least since Apache 1.2.  I don't know  
about other servers.  The simplest solution is to use the "int:escape" function  
of RewriteMap to cause the escape characters to be re-encoded before the final  
redirect.  That is:  
  
RewriteMap escape_again int:escape  
RewriteRule ^(.+) index.php/${escape_again:$1} [L]  
  
This worked beautifully on my local testing machine.  However, the RewriteMap  
directive is not allowed in .htaccess.  It has to be in your vhost config or  
httpd.conf.  I don't yet know if this is a configurable security setting, but  
it seems unlikely that the majority of site admin's will actually have this  
level of control.  (My current host is like this, but they might do it for me  
if I send in a support request.)  
  
The alternative to RewriteMap does not appear to be simple.  I Googled and  
tested and Googled and tested some more, but I am quite a novice when it comes  
to mod_rewrite.  There is no native "str_replace()" function, and the best I  
came up with was a very messy and hackish-looking set of rules that only worked  
if there was zero or one question-marks in the URL.  Not usable in my opinion.   
There are other escape characters too, and if we're going to allow titles in  
short URL's then we need to allow for any number or combination thereof.  
  
At present, I can think of two possible solutions:  
1. those who can, should use RewriteMap  
2. someone smarter at mod_rewrite than I should write a set  
of .htaccess/mod_rewrite rules for us that flexibly does the escaping  
  
But remember that double-escaping those characters works.  So, a third option  
which I am strongly in favor of at this point is:  
 
3. add a checkbox somewhere (probably Base Module Config?) that when checked 
causes the core's encode_shorturl() function to do double-escaping.  This 
allows for other servers/mod_rewrite implementations that don't have this 
problem like Apache. 
 
However, I expect there would be a way to auto-detect the need for this through 
the $GLOBALS array and if the following values in config.system.php are set: 
  
$systemConfiguration['BaseURI'] = '';  
$systemConfiguration['BaseModURL'] = '';  
  
-CDF  
  

-- 
Configure bugmail: http://bugs.xaraya.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
_______________________________________________
Xaraya_bugs mailing list
Xaraya_bugs (at) xaraya.com
http://xaraya.com/mailman/listinfo/xaraya_bugs