SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using js to redirect subdomains

    I have an exising site that I would like to use some subdomains to promote different aspects of the site. However, I really can't move these pieces to another virtual site, so I'm looking to use js to redirect a request to another page.

    Here's what I want to do.

    Point the following domains to a single ip:

    shop.powwows.com
    gathering.powwows.com

    On the single ip, have an index page that would read the header of the request and route shop.powwows.com to www.powwows.com/shop and gathering.powwows.com to www.powwows.com/gathering/

    Would this work?

    What would I need to put in js to do this?

    Or is there a better way?

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    uh, meta tags?
    <meta http-equiv="refresh" content=0;URL="http://www.powwows.com/shop">
    InQuE

  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry, I don't understand...do you have a reason for not letting the webserver handle this? Just park those babies....
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  4. #4
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    www.powwows.com/gathering is my vbulletin installation.

    I can't really move that to a new virtual directory so I wanted to just create a pointer to it.

  5. #5
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by InQuE
    uh, meta tags?
    <meta http-equiv="refresh" content=0;URL="http://www.powwows.com/shop">
    How can that do different ones though?

  6. #6
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    like say, your page is 'http://shop.myoldsite.com' ok? if you put in your shop.myoldsite.com the meta tag:
    <meta http-equiv="refresh" content="0;URL='http://mynewsite.com/shop'>
    it will automatically refresh to the site, mynewsitecom/shop. im not sure if thats what you mean, but ya
    InQuE

  7. #7
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right, but I want to have multiple domains pointing at the page and create a js file to read from the header the request and be able to redirect to the right page.

  8. #8
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by pgowder
    Right, but I want to have multiple domains pointing at the page and create a js file to read from the header the request and be able to redirect to the right page.
    Read from the HTTP header? Ain't gonna happen. Read from the URL, yes. Which do you want/need?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  9. #9
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need the header.

    Oh well, thought it could be done.

    Thanks!

  10. #10
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by pgowder
    I need the header.
    Use PHP, ASP, Java, or any other server-side language. They read HTTP headers just fine
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  11. #11
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, ok, I'll try that!


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
  •