You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Stefan Cars <st...@snowfall.se> on 2004/11/02 15:33:49 UTC

[users@httpd] mod_rewrite NC with external map

Hi!

I'm having problem with the rewrite situation below. What I want todo is 
to do a lookup in a file if there is an entry and in that case redirect 
it. It works perfectly if you type the URL as entered in the textfile 
BUT i want match non case sensitive. That means if you have entered 
"hello" in the file "Hello" should work aswell. Is there a way to do this ?

RewriteCond     ${users:$1|NOT-FOUND}   !=NOT-FOUND     [NC]
RewriteRule     /(.*)$  ${users:$1}     [NC]


Kind Regards,
Stefan Cars

---------------------------------------------------------------------
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


Re: [users@httpd] mod_rewrite NC with external map

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 02 Nov 2004 15:33:49 +0100, Stefan Cars <st...@snowfall.se> wrote:
> Hi!
> 
> I'm having problem with the rewrite situation below. What I want todo is
> to do a lookup in a file if there is an entry and in that case redirect
> it. It works perfectly if you type the URL as entered in the textfile
> BUT i want match non case sensitive. That means if you have entered
> "hello" in the file "Hello" should work aswell. Is there a way to do this ?
> 
> RewriteCond     ${users:$1|NOT-FOUND}   !=NOT-FOUND     [NC]
> RewriteRule     /(.*)$  ${users:$1}     [NC]

No, I'd guess that this isn't possible.  The [NC] refers only to the
comparison between the map lookup and the NOT-FOUND.  In your case,
you want a case-insensitive map lookup.  I don't believe this is
possible without hacking the code.

Joshua.

---------------------------------------------------------------------
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