SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: java redirect

  1. #1
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    java redirect

    I need a redirect script so when i type in sitename2.com it goes to sitename1.com.

    thanks
    ORT

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you want it done? With HTML? Java? JavaScript? HTTP?

    Preferably, you use the 301 Permanently Moved HTTP header. If you use Apache, you can use .htaccess to redirect sitename2.com to sitename1.com.
    Code:
    # this goes in the .htaccess of sitename2.com
    Redirect 301 / http://sitename1.com/
    Simon Pieters

  3. #3
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    What programming language do you wish to use? Java? JavaScript? Those are two very different languages.

  4. #4
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    javascript

    thanks again

  5. #5
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Moved to the JavaScript forum.

  6. #6
    SitePoint Member
    Join Date
    Oct 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what do you mean by "Moved to the JavaScript forum."?

  7. #7
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    I moved the thread to the JavaScript forum so our JavaScript gurus can find it an offer you help.

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    javascript redirect

    Put this script in your index page at sitename2.com
    HTML Code:
    window.location.href = "http://sitename1.com";


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
  •