Welcome to WebmasterWorld Guest from 54.145.176.252

Forum Moderators: bakedjake

Message Too Old, No Replies

Rewrite directive inside <VirtualHost>

it doesn't work without the [R] flag. why?

     
9:39 pm on Aug 11, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 18, 2002
posts:131
votes: 0


RewriteRule /foo.html /?section=foo [L]

That rule works fine if it's declared globally and there are no virtual hosts. As soon as I create a virtual host, I have to use the [R] flag or it won't work (I just get a 404).

I like it without the flag because then the real URL is hidden from users.

For example, the above would display as:
www.mydomain.com/foo.html

But with the [R] flag it shows up as:
www.mydomain.com/?section=foo

Kind of defeats the purpose of using rewrite... Any help on this?

3:14 am on Aug 12, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 7, 2001
posts:661
votes: 0


I am confused by what you are trying to do.

I don't think you have a file on your server named '/?section=foo', so the 404 is correct.

What is the pathname of the file you want to send to the user?

5:12 am on Aug 12, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 18, 2002
posts:131
votes: 0


My site is PHP-enabled, so /?section=foo resolves to a standard html page.