Hosting a website from different servers

by frankl
6 replies
Ok, I'll try to be as clear as possible.

I've got a domain name: mysite.com

I'd like to offer my service in different countries as well, but I don't want to host my service from different domain names. For example: mysite.es or mysite.fr

Instead I'd like my service to be available like this:

mysite.com/en/
mysite.com/ru/
mysite.com/fr/
and so on....

How do you host sites like this? Obviously if you want to provide efficiency you need a server in the target country, but can you point a server to a subdirectory?

What is the most efficient way (serverwise) for hosting if you want to maintain the subdirectory approach?

Thanks
#hosting #servers #website
  • Profile picture of the author bsuperc
    I would use a subdomain instead;
    en.mysite.com
    ru.mysite.com
    fr.mysite.com


    If you need help with this PM me and I can discuss cost of implementing it for you.
    {{ DiscussionBoard.errors[9995334].message }}
    • Profile picture of the author emptee
      Originally Posted by bsuperc View Post

      I would use a subdomain instead;
      en.mysite.com
      ru.mysite.com
      fr.mysite.com


      If you need help with this PM me and I can discuss cost of implementing it for you.
      Personally I wouldn't do this to start with - why throw away perfectly good DA or domain TF/CF whenever someone links to your site in different languages?

      You can't use different hosts for subdirectories, as it is the domain that your client's browsers will resolve prior to connecting. IMO, it's much easier and more scalable to manage one site, and replicate the data to multiple other servers for geographical proximity. Better yet.. just pay cloudflare a couple of dollars a month to cache your stuff for you. Managing multiple servers/databases/posts/pages/etc.. around the world will come back to haunt you

      Michael
      {{ DiscussionBoard.errors[9995470].message }}
      • Profile picture of the author bsuperc
        Originally Posted by emptee View Post

        Personally I wouldn't do this to start with - why throw away perfectly good DA or domain TF/CF whenever someone links to your site in different languages?

        You can't use different hosts for subdirectories, as it is the domain that your client's browsers will resolve prior to connecting. IMO, it's much easier and more scalable to manage one site, and replicate the data to multiple other servers for geographical proximity. Better yet.. just pay cloudflare a couple of dollars a month to cache your stuff for you. Managing multiple servers/databases/posts/pages/etc.. around the world will come back to haunt you

        Michael


        That's why I said to use subdomains, it's the only way to do what they were asking for.
        {{ DiscussionBoard.errors[9995727].message }}
        • Profile picture of the author ivankoke
          I can not tell for sure, but think you may create a database (tables for all languages) and then add a code into your website to catch visitor IP. You will also need a country code database which can be found online for free. When someone visit your page the code will search his IP range and will return a country code. Then the website will redirect to preferred language, something like...

          if ($countrycode = "fr") {
          $countrycode=fr
          } elseif ($countrycode = "ru") {
          $countrycode=ru
          } else {
          $countrycode=en
          }

          header('Location: mysite.com?lan='.$countrycode);

          This is just idea and not sure how it work in practise. You would probably need to place the same (or similar) code on all pages.
          {{ DiscussionBoard.errors[10016618].message }}
          • Profile picture of the author ZephyrIon
            Originally Posted by ivankoke View Post

            I can not tell for sure, but think you may create a database (tables for all languages) and then add a code into your website to catch visitor IP. You will also need a country code database which can be found online for free. When someone visit your page the code will search his IP range and will return a country code. Then the website will redirect to preferred language, something like...

            if ( = "fr") {
            =fr
            } elseif ( = "ru") {
            =ru
            } else {
            =en
            }

            header('Location: mysite.com?lan='.);

            This is just idea and not sure how it work in practise. You would probably need to place the same (or similar) code on all pages.
            You could do it like this or you could do it on an .htaccess rewrite level

            RewriteEngine On

            RewriteCond %{REQUEST_URI} ^/?$
            RewriteRule ^.*$ /nl/ [R]


            RewriteCond %{REQUEST_URI} !^/(nl)
            RewriteRule ^.*/(.*)\.html$ /nl [L,R=40
            4]

            RewriteCond %{REQUEST_URI} !^/(us)
            RewriteRule ^.*/(.*)\.html$ /us [L,R=40[/I]4]
            Signature

            Buy new book and be entered to win $100 to your Zelle, PayPal or CashApp! Plus, check out the free sample on https://Amazon.com/dp/B0BPL5VQ34. Thank you for your support! Contest ends at 1,000 purchases.

            See the life of a real affiliate on Instagram https://instagram.com/ckrecicki

            {{ DiscussionBoard.errors[10016638].message }}
  • Profile picture of the author David Beroff
    Or you could use the language preference settings from your visitors' browsers.
    Signature
    Put MY voice on YOUR video: AwesomeAmericanAudio.com
    {{ DiscussionBoard.errors[10017084].message }}

Trending Topics