Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-23 Thread Basil Mohamed Gohar
On 04/23/2009 03:22 AM, Tom Evans wrote: On Wed, 2009-04-22 at 23:22 +0800, Basil Mohamed Gohar wrote: On 04/22/2009 11:11 PM, Tom Evans wrote: On Wed, 2009-04-22 at 22:30 +0800, Basil Mohamed Gohar wrote: On 04/22/2009 10:17 PM, Eric Covener wrote: On Wed, Apr 2

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Tom Evans
On Wed, 2009-04-22 at 23:22 +0800, Basil Mohamed Gohar wrote: > On 04/22/2009 11:11 PM, Tom Evans wrote: > > On Wed, 2009-04-22 at 22:30 +0800, Basil Mohamed Gohar wrote: > > > >> On 04/22/2009 10:17 PM, Eric Covener wrote: > >> > >>> On Wed, Apr 22, 2009 at 10:14 AM, Basil Mohamed Gohar

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread André Warnier
Eric Covener wrote: On Wed, Apr 22, 2009 at 1:02 PM, Eric Covener wrote: RewriteRule .* http://%{SERVER_NAME}$1 [R] RewriteRule .* http://%{SERVER_NAME}$1 [R] I'll head Andre off -- yes you need to actually capture something to use $1 ;-) Well actually, I had pretty much accepted the negati

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Eric Covener
On Wed, Apr 22, 2009 at 1:02 PM, Eric Covener wrote: > RewriteRule .* http://%{SERVER_NAME}$1 [R] > RewriteRule .* http://%{SERVER_NAME}$1 [R] I'll head Andre off -- yes you need to actually capture something to use $1 -- Eric Covener cove...@gmail.com -

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Eric Covener
On Wed, Apr 22, 2009 at 12:48 PM, Tom Evans wrote: > Ah yes, that is different. I actually wrote a module to manage this for > my servers (the canonical rewrite rule doesn't work in certain edge > cases), it doesn't detect it automatically based upon the vhosts > ServerName (it uses a directive),

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Tom Evans
On Wed, 2009-04-22 at 23:22 +0800, Basil Mohamed Gohar wrote: > On 04/22/2009 11:11 PM, Tom Evans wrote: > > On Wed, 2009-04-22 at 22:30 +0800, Basil Mohamed Gohar wrote: > > > >> On 04/22/2009 10:17 PM, Eric Covener wrote: > >> > >>> On Wed, Apr 22, 2009 at 10:14 AM, Basil Mohamed Gohar

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Basil Mohamed Gohar
On 04/22/2009 11:47 PM, André Warnier wrote: Basil Mohamed Gohar wrote: Writing it by hand for all the different VirtualHosts is what I was trying to avoid. Doing it with variables was the goal, and it seems that is not possible. I've been writing it by hand for years now. ;) I think for

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread André Warnier
Basil Mohamed Gohar wrote: Writing it by hand for all the different VirtualHosts is what I was trying to avoid. Doing it with variables was the goal, and it seems that is not possible. I've been writing it by hand for years now. ;) I think for this kind of stuff, you should have a look

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Basil Mohamed Gohar
On 04/22/2009 11:11 PM, Tom Evans wrote: On Wed, 2009-04-22 at 22:30 +0800, Basil Mohamed Gohar wrote: On 04/22/2009 10:17 PM, Eric Covener wrote: On Wed, Apr 22, 2009 at 10:14 AM, Basil Mohamed Gohar wrote: Outside of htaccess, the pattern is compiled at startup, so you

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Tom Evans
On Wed, 2009-04-22 at 22:30 +0800, Basil Mohamed Gohar wrote: > On 04/22/2009 10:17 PM, Eric Covener wrote: > > On Wed, Apr 22, 2009 at 10:14 AM, Basil Mohamed Gohar > > wrote: > > > >>> Outside of htaccess, the pattern is compiled at startup, so you can't > >>> use variables (because they de

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Basil Mohamed Gohar
On 04/22/2009 10:17 PM, Eric Covener wrote: On Wed, Apr 22, 2009 at 10:14 AM, Basil Mohamed Gohar wrote: Outside of htaccess, the pattern is compiled at startup, so you can't use variables (because they depend on parts of the request, even ServerName). IIUC It's feasible in per-directory,

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Eric Covener
On Wed, Apr 22, 2009 at 10:14 AM, Basil Mohamed Gohar wrote: >> >> Outside of htaccess, the pattern is compiled at startup, so you can't >> use variables (because they depend on parts of the request, even >> ServerName). >> >> IIUC It's feasible in per-directory, but not implemented. >> >> > > So,

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Basil Mohamed Gohar
On 04/22/2009 09:20 PM, Eric Covener wrote: On Wed, Apr 22, 2009 at 8:21 AM, Basil Mohamed Gohar wrote: Hello everyone! What I am trying to do is use the server variable %{SERVER_NAME} as the CondPattern argument to the RewriteCond directive. However, all of my attempts appear to render

Re: [us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Eric Covener
On Wed, Apr 22, 2009 at 8:21 AM, Basil Mohamed Gohar wrote: > Hello everyone!  What I am trying to do is use the server variable > %{SERVER_NAME} as the CondPattern argument to the RewriteCond directive. >  However, all of my attempts appear to render the string '%{SERVER_NAME}' as > a string lite

[us...@httpd] Server-Variables in CondPattern of RewriteCond directive

2009-04-22 Thread Basil Mohamed Gohar
Hello everyone! What I am trying to do is use the server variable %{SERVER_NAME} as the CondPattern argument to the RewriteCond directive. However, all of my attempts appear to render the string '%{SERVER_NAME}' as a string literal, rather than replacing it with the variable name I expect (i.