SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Handling fake subdomains

    Not sure if in wrong section, but couldn't see where it might otherwise go!

    I need to offer up my site in different languages and have all subdomains forwarding to my main www.

    eg

    fr.domain.co.uk -> displays www.domain.co.uk

    So i need to add some code in the htaccess to take the 'fr' part of the domain and send it to eg

    domain.co.uk/fr/....

    What's the best way to do this?

  2. #2
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but why?
    Why don't you want to stay at fr.domain.co.uk?

  3. #3
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well really i havent decided exactly the best way to do this!

    I just actually found this which works:

    RewriteCond $1 !^forum/
    RewriteCond %{HTTP_HOST} ^forum\.example\.com
    RewriteRule (.*) /forum/$1 [L]
    This will mean duplicating all files in the subfolder fr/
    As most of my site is dynamically driven off several php files (+ mysql db), what is the best way to do multi language design?

  4. #4
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's the technology do you use for subdomain forwarding?
    Your web-server must be set up to handle subdomains without redirecting.
    so, request fr.domain.co.uk -> displays the same fr.domain.co.uk
    nothing else you need.

  5. #5
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    correct, but then i need to process which language was being called and apply that to the scripts.

  6. #6
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But you already know which language was being called!
    Why to use HTTP_HOST in mod rewrite if you can use it in your script?


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
  •