Welcome to WebmasterWorld Guest from 3.93.75.30

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

mod_rewrite directives- in which context?

works in <virtualhost>, not in serverconfig

     
2:20 pm on Nov 13, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 23, 2002
posts:110
votes: 0


hi guys,

i have the following simple rewrite directives:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^aaa
RewriteRule ^.* /other.txt [PT,L]

now, it works well on the <virtualhost> directive-
but as I want to apply it to all virtualhosts, i want to put it in server config- yet it doesn't work, for some reason, in the server config.

does anyone have an idea?

thanks!
f.

3:06 pm on Nov 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Two possible problems:

First, the local path "/other" is not yet defined in a config context - you could try a canonical URL -- "http://<something>" with an external redirect instead.

And -- possibly related -- why are you using the [PT] flag with a local pathname?

Jim

4:05 pm on Nov 13, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 23, 2002
posts:110
votes: 0


Ah. My bad. The PassThrough was mistakenly placed there- I just copied it from another rewrite I had-

Jim, following your suggestion- I tried:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^aaa
RewriteRule ^.* "http://www.domain.com/other.txt" [L]

still- it works perfectly on the virtualhost section, doesn't work at all on the serverconfig.
also, i tried to have a RewriteLogLevel 9, hoping to see something at the rewrite log file, but it was empty.

any more ideas?

thanks again for the reply,
f.

4:20 pm on Nov 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Have you specified RewriteOptions inherit for each virtual server? That may be required.

Jim

4:39 pm on Nov 13, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 23, 2002
posts:110
votes: 0


just tried "RewriteOptions inherit" in the virtualhost-

no luck :-(
still doesn't work...

6:36 pm on Nov 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


flex55,

Well, I'm fresh out of ideas... Perhaps a read through some other threads on this subject [google.com] will help.

Jim

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members