SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    89
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Redirecting my site

    Hello
    My site works with 2 URLS.
    First: www.mysite.com
    Second: www.mysite.com/he
    he = the default language

    and both shows the same page, because this langauge is default.

    I was thinking about redirecting www.mysite.com to www.mysite.com/he

    1. How I can do that with .htaccess?
    2. to change languages, the website url will be www.mysite.com/en
    Will step 1 will cause any problem to this translations?
    Owner of uReviews & MovieDB - Movie Database

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,672
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    unreal,

    While I'd try to do that in mod_rewrite code (in .htaccess), I can't think of how to access the browser's default language off the top of my head. On the other hand, there are major websites which use mod_negotiation for exactly what you're trying to do. Unfortunately, I have not studied mod_negotiation so I have to simply recommend that you go to apache.org and look at:

    Content-Language:
    The language(s) of the variant, as an Internet standard language tag (RFC 1766). An example is en, meaning English. If the variant contains more than one language, they are separated by a comma.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •