Forum Moderators: phranque

Message Too Old, No Replies

Show original uri in browser addressbar when use mod_rewrite

         

tiger_K

12:05 am on Jan 9, 2004 (gmt 0)

10+ Year Member



Hi,

On some other website visitors following a textlink to a pic on my website see the rewrited address of the pic in the browser's addressbar.

I don't want them to know the rewritten address, showing just the address of the original pic.

Is this possible?

Thanks

Dominik

jdMorgan

1:55 am on Jan 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the rewrite is occurring on your server (the same server that holds your images), then use an internal rewrite instead of a redirect. An external redirect sends a message to the client (browser) giving the new URL, and tells the client to re-request the resource from that address, therefore, the client borwser's address bar gets updated before this second request is issued. An internal rewrite will not update the client's address bar, since no communication with the client takes place during an internal rewrite -- It is a simple file substitution, and occurs entirely within the server's filespace.

If the rewrite is occurring on a different server, then you cannot control the address bar.

External redirect:

 RewriteRule ^pic1\.jpg$ http://example.com/pic2.jpg [R=301,L] 

Internal rewrite:

 RewriteRule ^pic1\.jpg$ /pic2.jpg [L] 

Jim

tiger_K

11:23 am on Jan 9, 2004 (gmt 0)

10+ Year Member



All right now.

I used flag [R] (ext redirection), removed it and now the rewrite doesn't show in browser bar, as I wished.

Thanks for you help!

Dominik