homepage Welcome to WebmasterWorld Guest from 107.20.25.215
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Internal Redirect .jp -> .com/folder/
frychiko




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

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:

http://example.jp

to

http://example.com/japan/

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

cheers,
Peter

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

 

frychiko




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

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]

g1smd




msg:3820589
 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




msg:3821354
 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




msg:3821588
 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).

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved