Forum Moderators: phranque

Message Too Old, No Replies

SubDomain rule

         

nickCR

11:41 pm on Jun 13, 2007 (gmt 0)

10+ Year Member



I have a site which I would like language enabled, however I was thinking making es.example.com for the spanish version however I need to mask that to the location on my server that has the script for example:

es.example.com would actually load www.example.com/content/

Is this impossible?

nickCR

12:09 am on Jun 14, 2007 (gmt 0)

10+ Year Member



Just to be super clear:

I am a client and go to:

es.example.com/

That will be actually loading:

www.example.com/

The address bar will show:

es.example.com/

www.example.com/ would read the HTTP_HOST to determine how to set the language variable.

jdMorgan

12:28 am on Jun 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming that you already have the DNS set up so that the es subdomain requests are delivered to your server's IP address, and that the server is configured to deliver requests for that subdomain (or all subdomains) to your "account space" by the host, then this is a simple internal rewrite.

Try a search here for "subdomain subdirectory rewritecond http_host rewriterule" -- and for more background information (including how to get the best responses in this forum), see our forum charter [webmasterworld.com], the documents cited therein, and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim

nickCR

1:13 am on Jun 14, 2007 (gmt 0)

10+ Year Member



Sorry Jim, wasn't asking for a freebie here. I have tried probably 50 variations of the codes posted here and nothing is working all returning 500 messages. I have emailed my host though as i'm on a Shared setup running cPanel and I think they are going to be the ones that have to do this maybe on a DNS level which would be ideal for me as I don't have any messy rewrites.

The concept is simple but apparently it's not so easy to do!

jdMorgan

4:46 am on Jun 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're getting a 500 error, that means either there's a problem with your code, or mod_rewrite is not installed or enabled.

If you can reach your site at all using the subdomain, then it's not a DNS problem.

Please post your code as a basis for discussion, changing only the domain name to example.com, along with any other useful info about your situation, such as where you put the code.

Jim

nickCR

2:02 pm on Jun 15, 2007 (gmt 0)

10+ Year Member



Thanks Jim, I think I can easily achive this without any complicated rewrites by simply creating a symbolic link to public_html from the sub-directory.

It seems quick, easy and very light weight. What do you think?