how to mask a url address for a web site.
Thanks,
Srinivas
What do you mean by that? Check if URL fits to some pattern template?
> how to mask a url address for a web site.
Perhaps you are looking for something like
var esc = (typeof encodeURIComponent == "function"
? encodeURIComponent
: (typeof escape == "function"
? escape
: function(x) { return x; }));
alert(esc("http://foo.bar/baz"));
PointedEars
The customer hosts the actual site (decc.com). The URL's they want
to use would list as follows:
What we want to do is have the user type in the url listed (I made them
up) and have decc re-direct to our web pages.
the customer wants the url to show up on the address bar on Srini end
as listed above
Essentially we are mis-stating the url the user is actually on.
Obviously the user would be on a Srini address at the time they are on
the web landing page BUT the question is whether or not we can spoof
the address to show the url the user originally entered.
> is it possible to "mask" a URL address?
>
> The customer hosts the actual site (decc.com). The URL's they want
> to use would list as follows:
>
> www.decc.com/abcd
>
> www.decc.com/blablabla
>
> www.decc.com/someword
>
> What we want to do is have the user type in the url listed
> (I made them up) and have decc re-direct to our web pages.
There are two possible ways I can think of:
1. Use a redirection frameset. It introduces several
disadvantages and is therefore strongly discouraged.
2. Do the redirection server-side, best using URL rewriting:
<http://httpd.apache.org/docs/2.0/misc/rewriteguide.html>
None of this has to do with programming JavaScript at all.
PointedEars
thanks for responding to my message
What i need is if i enter www.google.com in the addressbar,then the
site should redirects to www.gmail.com/index.aspx page but we can see
www.google.com in the url address bar.
Thanks
> What i need is if i enter www.google.com in the addressbar,then the
> site should redirects to www.gmail.com/index.aspx page but we can see
> www.google.com in the url address bar.
Yes, both of my suggestions are applicable to achieve
this (if you're the owner of google.com, of course ;-)).
HTH
PointedEars
As I'm currently in anti-IE mood for some reason :-), here's an IE-only
trick (FF is smart/secure enough for equivalents).
<html>
<head>
<title>URL Spuffing</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="JScript">
function spuffURL() {
var fakeBar = window.createPopup();
fakeBar.document.body.innerHTML =
'<span style="font: 8pt MS Sans Serif, sans-serif">' +
'http://www.google.com</span>';
fakeBar.show(70,-20,300,16,document.body);
/* Of course the exact coords will vary greatly
depending on installed Explorer bars and screen resolution.
So it's a jeux d'esprit rather then an actual hack. */
}
window.onload = spuffURL;
</script>
</head>
<body bgcolor="#FFFFFF">
</body>
</html>