/    Sign up×
Community /Pin to ProfileBookmark

I have a somewhat complex question. I have 2 web domains that I want to register, one will probably get a lot of traffic and the other will probably not. So I contacted my web hosting service, to see if they could point the second domain to a subfolder of the account I have with them for the first one. So that I could simply share the bandwidth and filespace of those two pages from my one account. But they say they are unwilling to do this, and all new domains can only point to the main directory of my account.

So, I was wondering if there was any way to have my index page check which address they entered and then redirect them to a subfolder for that page. Such as obviousexample.com and otherexample.com both open the same homepage, but that homepage reads which address was entered, and then redirects the user to the proper homepage such as obviousexample.com/page2/. Is there any way to do this? Any help would be greatly appreciated. Thanks.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Dan_DrillichMar 05.2003 — Please try -

<i>
</i>if (window.location == "http://www.obviousexample.com")
window.location = "http://obviousexample.com/page2.html";
×

Success!

Help @Vengeance000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...