Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Internal Redirect .jp -> .com/folder/



11:57 am on Jan 6, 2009 (gmt 0)

5+ Year Member

Hi I'm new here!

I've been searching for a couple of days now but am unable to find an answer for this exact situation (if a solution is even possible):

I am making a Japanese version of my site and data for the Japanese version of the site lies in a subfolder of my main site not on a different physical site.

I would like to internally redirect:




so if someone visits http://example.jp/smelly.html

the file fetched would be http://example.com/japan/smelly.html

but the url the user types stays the same and does not show the internal "japan" folder and .com domain name.

Is this possible (without using frames)?


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


2:12 pm on Jan 6, 2009 (gmt 0)

5+ Year Member

Problem solved!

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]


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

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

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)

5+ Year Member

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


however would display as


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.


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

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

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).



Featured Threads

Hot Threads This Week

Hot Threads This Month