Welcome to WebmasterWorld Guest from 3.234.210.89

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Show original uri in browser addressbar when use mod_rewrite

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

New User

10+ Year Member

joined:Jan 6, 2004
posts:5
votes: 0


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

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

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


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

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

New User

10+ Year Member

joined:Jan 6, 2004
posts:5
votes: 0


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