How To Mask URL?

suzee_lk's picture

They have: 2 posts

Joined: Jan 2009

I want to mask the URL displayed on the ADDRESS BAR how can I do like that? Say.. I want to redirect the domain name ABC.COM to say XYZ.COM but I want to show the URL ABC.COM on the ADDRESS BAR instead of XYZ.COM. Plase help me...

He has: 698 posts

Joined: Jul 2005

Well, assuming you have mod_rewrite on (you can check phpinfo(); to see), you can place the following in a file called ".htaccess" in your root folder.

RewriteEngine On
RewriteRule ^ABC.COM$ XYZ.COM [NC,L]

You would change ABC.COM to the full URL you want to appear in the address bar and XYZ.COM to the URL you want to actually be accessed. NC simply means that the string is case-insensitive, and L means that if this rule is matched, stop; that's really most important if you have multiple rewrite rules. Wink

Kurtis

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Why would you want to mask the actual domain?

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

pr0gr4mm3r wrote:
Why would you want to mask the actual domain?

I have a client who is an ad agency

I built a "Leadtracker" site with Drupal to collect and analyze campaign data, primarily with webforms and Google Analytics (we're also testing Clicky and Woopra)

The main website has its own domain name (which should only be viewed by admin), and we're running a few multisites off the same code. There are several "satellite" sites on and off the Drupal site that drive traffic to the main site for various campaigns.

Many campaigns have their own "masked" domain name - useful for analytics and tracking

We are masking them with the GoDaddy URL mask feature, which places the masked url in a frame (I did not pick GoDaddy, but this is a convenient tool). You could alternatively set up your own framed/masked url.

It works... Smiling

They have: 5 posts

Joined: Feb 2009

Can I use a tinyurl generator?

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

jane0109 wrote:
Can I use a tinyurl generator?

tinyurl is a neat way to shorten a long meaningless url

however, it is not that good for SEO

They have: 2 posts

Joined: Feb 2009

try doing a 301 redirect if you want to redirect one domain to another..

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.