frychiko

1) set up example.jp as an alias for the first domain 2) add in a .htaccess file to handle the internal routing from / to /japan/

[edited by: eelixduppy at 3:02 pm (utc) on Jan. 6, 2009]

g1smd

11:23 pm on Jan 6, 2009 (gmt 0)

You also need a redirect in case they request the file directly at its "real" location.

The redirect will make their browser make a new request for the "correct" URL.

CWI Tech Guy

8:18 pm on Jan 7, 2009 (gmt 0)

Your host may also be capable of setting of the domain as an addon domain or a pointer. In Cpanel specifically, their is a function where you can setup an additional domain within the account to function as a separate site, loading data from a specific folder. In your case, it would load from

http://example.com/japan/

however would display as

http://example.jp

The redirect you specified would work, however this has an advantage in the URL does change. Ask your host whether they have something like this.

jdMorgan

2:21 am on Jan 8, 2009 (gmt 0)

The original poster specified an "internal redirect," so there is no client redirect here. His solution was an internal rewrite, transparent to the client, and more or less equivalent to what cPanel would do at the httpd.conf or conf.d level, except that with a .htaccess rewrite, the two "domains" can "see" each other's filespace, and the requests for the "add-on domain" will also be processed through the root (main domain's) .htaccess file, which just calls for a bit of extra care.

Our typical poster here has overrun cPanel's limited customizations, and is looking to do something that the cPanel script cannot do (because it is a general configuration script meant to correctly configure many hosts' very-different preferred server set-ups).