views:

24

answers:

2

Hello!

I'm doing something very simple with mod_rewrite and it's behaving strange. It's behaving as if I'm using the [R] option, but I'm not. Here's a simple test for a .htaccess file:

RewriteEngine on
RewriteRule ^page1$ page2

This should redirect a request for page1 to page2, but leave the URL in the web browser still pointing to page1. That doesn't happen though. It actually switches the URL to page2, as if I were using this code:

RewriteRule ^page1$ page2 [R]

Why's it doing that? That's not the default behavior. I'm using a pre-configured machine I got for EC2, so it's probably something in the apache configuration I'm not aware of. Googling has been futile. Help?

This is Apache 2.12 btw.

+1  A: 

DirectorySlash is often the culprit. If not, and no further rewriting is done, consider using [L]

Wrikken
Thanks! Unfortunately, that's not it... any other ideas?
Tal
A: 

I fixed it... not exactly sure what I did (doh!) because I futzed around with it a bunch. I'll try to to some investigative work so I can share the solution.

Thanks!

Tal