Forum Moderators: phranque

Message Too Old, No Replies

rewrite without changing browser url

Is there a way to get mod rewrite rules not to change browser url

         

sichen1234

4:18 pm on Jul 14, 2004 (gmt 0)

10+ Year Member



Hello. Is there a way for mod rewrite not to change the url shown in the browser?

For example, right now, if I re-direct:
[mysite.com...]

to
[mysite.com...]

Then the visitor will see the second URL, not the first. Is there anyway to keep the "friendly" url on the browser?

Thanks,

Si Chen

jdMorgan

4:26 pm on Jul 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Si Chen,

Yes, simply use a local path instead of a canonical URL in the substitution, and omit the [R] flag at the end of the rule.

Jim

sichen1234

9:34 pm on Jul 14, 2004 (gmt 0)

10+ Year Member



Thanks for your response, but I'm sorry I couldn't understand exactly what you mean. This is what a sample rewrite rule looks like:

RewriteRule /static/([^~].*) [mysite.com...]

There is no [R] at the end right now, and I have to use the site address because it is a re-direct via mod_jk.

Do you have an example by any chance? Thanks,

Si Chen

gergoe

12:13 am on Jul 15, 2004 (gmt 0)

10+ Year Member



...so the following is not work as it is expected?

RewriteRule /static/([^~].*) /webstore/control/static/~page=$1

sichen1234

12:56 am on Jul 15, 2004 (gmt 0)

10+ Year Member



No unfortunately it will not work, because it will then go look in /var/www/html/ directory for the re-directed URL, whereas in fact I need it to go through mod_jk2 to a Java server.

Is forcing the IP address (host name) causing it to re-write the URL in the browser?

In my access-log, it still shows a result of "200" and not "redirected."

At the very least, does the URL changing in the browser cause search engines to consider it spam?