httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Foley <bri...@maths.tcd.ie>
Subject [users@httpd] mod_rewrite and special characters
Date Wed, 18 Aug 2004 18:59:33 GMT
Hi All,

I posted this query to alt.configuration.apache a few days ago, but
got no response.  Apologies to those of you who are reading this for
the second time.  If my question is too simple, or not clear enough to
be answered, I would appreciate somebody pointing that out to me :-)



From: alt.configuration.apache:

Hello,

I have the following rule in my .htaccess file:
RewriteRule ^results/championship/(.*)/
/results/index.pl?championship=$1

Designed to rewrite URLs of the following form:
http://www.domain.com/results/championship/ABC/
into:
http://www.domain.com/results/index.pl?championship=ABC

This works as expected as long as the string ABC does not contain any
special characters.  One string I would like to use is "T&F".  The
URL:
http://www.domain.com/results/championship/T%26F/
gets transformed into:
http://www.domain.com/results/index.pl?championship=T&F
instead of the desired:
http://www.domain.com/results/index.pl?championship=T%26F

My problem being that the index.pl script thinks that "championship"
is "T" instead of the desired "T&F".

Is there a way to ask apache NOT to transform any url-encoded strings
it encounters while rewriting the URL?

I have come across rules like:
RewriteMap esc int:escape
which sound like they should work, while browsing the manual and
searching google.  Unfortunately, RewriteMap has to be in the
httpd.conf file and I only have access to .htaccess.

Anybody have a solution that will work in my .htaccess file?

Can somebody confirm whether RewriteMap is likely to work?  If I
managed to convince my hosting provider to insert a RewriteMap rule
into the global httpd.conf file, would I be able to use "esc" in my
.htaccess file, or would both RewriteMap and RewriteRule statements
need to be in the same file?

Thanks,

Brian.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message