Item8101: Extensions.ModPerlEngineContrib suggests broken URL rewrite rules, making some extensions fail
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Hi, when using the URL shortening trick as suggested (???) by
ModPerlEngineContrib#Shorter_URLs, which looks like this in httpd.conf
Alias /wiki /data/www/domain.com/wiki/bin/view
RewriteCond %{REQUEST_URI} ^/+wiki/+bin/+view/+ [NC]
RewriteRule ^/+wiki/+bin/+view/+(.*) /wiki/$1 [L,R]
then
EditRowPlugin will break. I assume it is due to the REST stuff. When clicking on the edit button, the page will reload, but the edit widgets don't appear. It looks just like before.
--
UlrichSpoerlein - 05 Apr 2009
I could not reproduce this. I tested both with javascript enabled and disabled. (Firefox 3.0.7 on Linux)
Which apache version are you using? Does this problem happens only with short url enabled and ModPerlEngineContrib? (please, test with plain CGI and both with short urls enabled and disabled)
I tested with apache 2.2.11 and mod_perl 2.0.4.
--
GilmarSantosJr - 09 Apr 2009
Bummer, perhaps this is related to me using a https only host, all HTTP requests are redirected as https. But I think that is not really the problem. What happens is this: I have this topic open with an
EditRowPlugin edit button, which links to:
https://www.XXX.net/wiki/bin/view/Sandbox/VdcActivityETMS?erp_active_topic=Sandbox.VdcActivityETMS;erp_active_table=EDITTABLE_1;erp_active_row=-1#erp_EDITTABLE_1
When clicking this link, there will be a redirect done from bin/view to the "shorter URL", but somewhere along the line it get's messed up, as I see the following in the IE6 address bar after the page has loaded:
https://www.XXX.net/wiki/Sandbox/VdcActivityETMS?erp_active_topic=Sandbox.VdcActivityETMS%3berp_active_table=EDITTABLE_1%3berp_active_row=-1
Yes, the semicolons have been whacked. Changing %3b in the address bar to ; I suddenly get the
EditRowPlugin controls back (some of them, at least). Saving the table actually works, but I cannot add new rows ...
I
do see two reqs per button press, the first is answered by 302 as per mod_rewrite and then the URI gets mangled. I'm not sure who's to blame. Should mod_rewrite pass the semicolons as-is? Who came up with this scheme anyway, what happened to good old "foo=1&bar=0"? How many requests do show up in your access log?
--
UlrichSpoerlein - 11 Apr 2009
I saw this before. It has nothing to do with mod_perl. Try to put this in your apache conf:
# short urls
RewriteEngine on
RewriteRule ^/+wiki/+bin/+view/+(.*) /wiki/$1 [L,NE,R]
RewriteRule ^/+wiki/+bin/+view$ /wiki/ [L,NE,R]
Notice the
NE
option to
RewriteRule
. It should solve your problem.
ApacheConfigGenerator already has this options and I'll update
ModPerlEngineContrib's documentation as well.
--
GilmarSantosJr - 11 Apr 2009
Thanks for the hint. It is now working fine with your rewrite rules. Task will be closed
--
UlrichSpoerlein - 12 Apr 2009
I'm reopening, so I can make the changes in SVN and release the fixed version.
--
GilmarSantosJr - 12 Apr 2009