Page 1 of 1

Question: mask url of links inside an email

Posted: Tue Mar 25, 2008 1:19 am
by jeboy25
Is it possible to mask the url of links inside an email?

e.g.
the url is: http://www.domain.com/contact.php?id=2&name=john

but will display as: http://domain.com/contact.php only when the mouse pointer hovers the link

Re: Question: mask url of links inside an email

Posted: Tue Mar 25, 2008 1:49 am
by Chris Corbyn
Send the email in HTML format?

Re: Question: mask url of links inside an email

Posted: Tue Mar 25, 2008 1:53 am
by jeboy25
yes its an html format

Re: Question: mask url of links inside an email

Posted: Tue Mar 25, 2008 1:58 am
by Chris Corbyn
I'm not sure what you're asking then?

Code: Select all

<a href="http://server.tld/?foo=bar">http://server.tld</a>
?

Re: Question: mask url of links inside an email

Posted: Tue Mar 25, 2008 2:10 am
by jeboy25
What I mean is, the actual url of the link for example is http://www.domain.com/contact.php?id=2&name=john but I want it to be displayed as http://www.domain.com/contact.php only when the recipient mouse over the link.

In outlook 2007, when you mouse over or hover a link inside an email, it will display the target url of that link. So what I would like to achieve is when the recipient mouse over a link in my email it will display the url http://www.domain.com/contact.php instead of http://www.domain.com/contact.php?id=2&name=john which is the true url

Re: Question: mask url of links inside an email

Posted: Tue Mar 25, 2008 4:30 am
by Chris Corbyn
Hmm... sounds fishy 8O

The short answer is no, unless email clients have started allowing the use of JavaScript and implement the window features as fully as a browser would. If all you're worried about is how clean the URL looks then you can use a redirect.... however, the thing that jumps to mind when someone asks something like this is "phishing" which I seriously hope you're not ;)

Re: Question: mask url of links inside an email

Posted: Tue Mar 25, 2008 6:07 pm
by jeboy25
Yeah I know exactly what you mean. Actually theres no problem with our current url which has parameters, its just our boss wants to display the url to the subscriber with no parameters because he thinks that maybe the subscriber will get intimidated to click it if he see a parameters in the url of the links inside our email to him. I know that javascript is not allowed in email clients. I also strongly disagree to phishing activities.

Re: Question: mask url of links inside an email

Posted: Wed Mar 26, 2008 3:02 am
by xdecock
maybe you can use mod_rewrite to provides url like this:

http://www.domain.com/m/2/john/contact.php

With a rewriteRule like this:
rewriteRule /m/([0-9]+)/([a-zA-Z0-9]+)/contact.php contact.php?id=$1&name=$2

(I didn't tested it, it can be improved, but it's a base)

PS: the /m/ is to start the url with a specific folder (m for mailing here)

[edit: corrected typo]

Re: Question: mask url of links inside an email

Posted: Wed Mar 26, 2008 7:16 pm
by jeboy25
xdecock, how can I do mod_rewrite? remember that its a hyperlink inside an email.

Re: Question: mask url of links inside an email

Posted: Wed Mar 26, 2008 7:49 pm
by Chris Corbyn
jeboy25 wrote:xdecock, how can I do mod_rewrite? remember that its a hyperlink inside an email.
You put the clean hyperlink in the email and handle the rewrite at a server level. The same way you do it in a web application.

Re: Question: mask url of links inside an email

Posted: Thu Mar 27, 2008 5:38 am
by dillion
Why not replace the link with something less "personal" so the user is not intimated, e.g.

http://www.domain.com/contact.php?i=2&n=u2gkhk12 (using less obvious parameter variables and encryption).

Or use:
http://www.domain.com/redirect.php?i=uihkuhk22hi12979 (which based on the i value, redirects to contact page and display relevant details on contact page)