Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite works but. changes back to old URL

         

loganz

8:01 am on Mar 30, 2007 (gmt 0)

10+ Year Member



i just switched hosts and for some reason my mod_rewrite is acting weird.

here is what i have now

RewriteRule ^(.*)/$ [mydomain.com...] [L]

i have links that are written as:
[mydomain.com...]

but when i click it, it goes to that page but the url switches back to:
[mydomain.com...]

everything seems to be working fine, just the URL changes back to its old form

any idea what the problem is?

jdMorgan

1:41 pm on Mar 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As documented, if you include a full canonical URL as the substitution, mod_rewrite assumes you want an external redirect. So it sends a 302 redirect response to the browser, telling it to re-request the required object from the supplied URL, and this is what changes the address bar.

So I'd suggest:


RewriteRule ^(.*)/$ /index.php?post=$1 [L]

Jim

loganz

6:11 pm on Mar 30, 2007 (gmt 0)

10+ Year Member



thanks a lot jd, it worked..

i thought i was going crazy, it worked fine on my old host =)