SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mod Rewriting one domain to another

    I have a really urgent problem: I have one domain (www.example.com) and I want to redirect any requests to another domain hosted elsewhere (www.temp.com). Thus, if a user requests http://www.example.com/people/ he will actually get served http://www.temp.com/somefolder/people/ but his address bar will still say http://www.example.com/people/ . I'm sure this is easy, I just have no experience with .htaccess and mod_rewrite and I'm in a real bind! Thanks for the help.
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/

  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)
    dalan,

    This was just covered in another post. I don't believe that this is possible as the domain redirect will sent the visitor to another server. Try this and you'll find out though:
    Code:
    RewriteEngine On
    RewriteRule ^(.*)$ http://www.temp.com/somefolder/$1 [L]
    Let us know how that works. I'd appreciate knowing whether this can be done or not and will accept the smack on the wrist if the new URL is hidden.

    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

  3. #3
    SitePoint Wizard Dean C's Avatar
    Join Date
    Mar 2003
    Location
    England, UK
    Posts
    2,906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm interested in this, because it'd almost be like spoofing and could be potentially very dangerous.

  4. #4
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, the URL changes. Thanks anyway, this will be a fine solution for now.
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/

  5. #5
    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)
    dalan,

    Thanks for that feedback! As Dean inferred, it's better this way!

    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

  6. #6
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I certainly appreciate the security aspect of it, though it dosen't solve the "client told me they had PHP installed but they didn't and I don't have access to their server configuration" problem I'm having.
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/

  7. #7
    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)
    dalan,

    Well, there is still one way - ugly as it is: Build a frameset wtih your frame a 1px band across the bottom or right and put your other site in the main frame. The down side is that the links would not show in the URL as your visitor goes from page to page in the new site. Hmmm, also, that a LOT of webmasters know how to avoid being shown in others' frames like that.

    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
  •