Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

SetEnv + RewriteCond

閲覧: 36 回
最初の未読メッセージにスキップ

Maxim Cherniavsky

未読、
2003/12/09 12:18:112003/12/09
To:
I'm triyng to use envirment variables in RewriteCond's, something like this

<VirtualHost>
RewriteEngine on
SetEnv switch true

RewriteCond %{ENV:switch} ^true$
RewriteRule ^.*xxx.*$ /toxxx/ [R,L]
...
</VirtualHost>

But this is not working. What can be wrong?
Thanx

--
Best regards,
Maxim Cherniavsky
mailto:ma...@mtu.ru

Joachim Ring

未読、
2003/12/13 20:48:582003/12/13
To:
> I'm triyng to use envirment variables in RewriteCond's, something like this
>
> <VirtualHost>
> RewriteEngine on
> SetEnv switch true
>
> RewriteCond %{ENV:switch} ^true$
> RewriteRule ^.*xxx.*$ /toxxx/ [R,L]
> ...
> </VirtualHost>
>
> But this is not working. What can be wrong?
> Thanx

if you set those env-variables yourself with mod_env, the result
depends on the execution order of the modules, which for apache 1.3 is
the reverse loading/adding order (added/loaded last modules get their
go first) and afaik with apache2 is mostly fixed in the module source
(not shure here wether it's always fixed and how it can be changed).

so with 1.3 you might experiment with moving mod_env to the bottom of
the LoadModule and/or AddModule lists and retry, or you set the
environment variable with mod_rewrite (see [E=variable:value] flag to
RewriteRule), which should work in any case.

joachim

新着メール 0 件