/    Sign up×
Community /Pin to ProfileBookmark

Redirect with request url variable

i have a domain and a additional domain to the same host server count.

How can i redirect in the index page, to a diferent folders depending of the request url, like
if [url]www.abc.com[/url] go to /abc/
if [url]www.xyz.com[/url] go to /xyz/

i need to made this in javascript
couse a can`t change the site structure

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMay 23.2006 — Seems to me that there are [B].htaccess[/B] file definitions you can make in the site root folder which will perform this redirect without requiring the use of JavaScript -- which might be disabled or bypassed -- but, I don't really know anything other than that about [B].htaccess[/B] files. But, if you want JavaScript code for this, I can still supply that.
×

Success!

Help @brunovt 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...