Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite problem

it changes what the address bar says

         

SteveCA

11:05 pm on Nov 23, 2003 (gmt 0)

10+ Year Member



hey guys,

i've been using mod_rewrite for a while now on my own apache server on a windows machine. i just recently tried to implement what i've done using a hosting service running apache on linux and i have a peculiar problem.

when it executes the rewrite rule, it actually changes what the address bar says. this was not happening to me when i did it using my own server. i'm kinda dumbfounded and wondering if anyone knows what the problem is.

i'm thinking it might have something to do with other apache mods that are installed. for example, i get a sbox error when i try typing in a folder that doesn't exist. ordinarily my rewrite would kick in and open a php script that would redirect the request to another page.

that would be great if anyone could help me out with this!

thanks,
steve

jdMorgan

11:11 pm on Nov 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Steve,

Yeah, it sounds like the host is 'layering' an external redirect on top of whatever you did.

Try using the Server Headers Checker [webmasterworld.com], and see where the redirect is taking place.

Jim

SteveCA

9:22 pm on Nov 24, 2003 (gmt 0)

10+ Year Member



thanks for the link. it gives me a "302 found" status code. i looked it up but still not quite sure on how to fix it. any ideas?

jdMorgan

9:46 pm on Nov 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, that 302 is an external redirect. If *you* are not doing it on purpose, then someone is.

Follow the URL given in the 302 response, and keep following through any other 301 or 302 responses - you are tracking down the path that any browser would go through to get to your page.

See Server Response codes: [w3.org...]

Jim

SteveCA

12:48 am on Nov 25, 2003 (gmt 0)

10+ Year Member



ok, i think i understand what's going on. thanks for all your help jim. indeed my host is using a "hard" redirect which will obviously change what the address bar says. i emailed them and they say that mod rewrite is acting normal. this isn't what i want however. do you know of any hosts that don't have that external redirect?

steve

jdMorgan

12:58 am on Nov 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, *most* hosts don't interfere with your site... I have found that it's a bad idea to try to save money on hosting, so go with a good host, and consider price secondarily.

Lots of threads around here on hosting recommendations [google.com], but I try to make it a habit not to play favorites. :)

Jim

SteveCA

12:59 am on Nov 25, 2003 (gmt 0)

10+ Year Member



i'm reading the mod rewrite documentation right now. is there any way to override settings that have been made on the server from my .htaccess file that have to do with the external redirect that's going on?

SteveCA

1:00 am on Nov 25, 2003 (gmt 0)

10+ Year Member



oops i was typing when you posted that. thanks, i will check that link out. :D