SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    May 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Redirect an entire site...

    I would really appreciate any help anyone could give.

    I recently moved my forum to a new domain. The old location was

    http://www.bobby131313-trading-assis...ns.com/forums/

    I moved it to

    www.coincommunity.com/

    I have deleted the old forums. I have an error page set up to tell people the forum has moved with a link.

    I'm sure it is frustrating for people that click a SE link to a thread then they have to start over on the default page of the forum and search again. So here's my question...

    Is there some coding that I could put on the error page that would redirect any url to the forum directory to the new domain, but would just swap out the domain of the referring url?

    For example, if some one gos to

    http://www.bobby131313-trading-assis...sp?FORUM_ID=22

    Can I have it forward to

    www.coincommunity.com/forum.asp?FORUM_ID=22

    The forums are identical except for the domain.

    I'm on a Windows server running IIS6 but I do not have access to IIS controls. ASP and PHP are supported.

    Thanks in advance.

  2. #2
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Kingston
    Posts
    246
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just set up a forum.asp page in the forums directory that does
    <% Response.Redirect("http://www.coincommunity.com/forum.asp?FORUM_ID=22") %>

  3. #3
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't know ASP, but you should send a 301 Permanently Moved header so that the SEs spider your new domain and drop your old one.
    Mike
    It's not who I am underneath, but what I do that defines me.

  4. #4
    SitePoint Member
    Join Date
    May 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not really concerned about the SE's on the new site as we were relatively new anyway. Google has indexed the new site already, probably since the new domain was forwarding to the old one for about 3 months.

    Just set up a forum.asp page in the forums directory that does
    Quote:
    <% Response.Redirect("http://www.coincommunity.com/forum.asp?FORUM_ID=22") %>
    That's not exactly what I'm looking for. What I'm looking for is some coding to strip the "forum.asp?FORUM_ID=22" off of the request to the old domain and add it it to the new domain and redirect. The red part will be different depending on what forum or topic the user is going to.

  5. #5
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    IIS has URL rewriting capabilities, though I don't know how off hand. I've seen it done. Just find the IIS equivilant to mod_rewrite and you're set
    Mike
    It's not who I am underneath, but what I do that defines me.

  6. #6
    SitePoint Member
    Join Date
    May 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I already explore that route. I called my hosting company about it and they said access to IIS controls is only available to dedicated server accounts which I don't have.

  7. #7
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    all you need to do mate, is this..

    <%

    query = ""

    for each item in request.querystring

    if instr(query,"?") then

    query = query & "&" & item & "=" & request.querystring(item)

    else

    query = query & "?" & item & "=" & request.querystring(item)

    end if

    response.redirect "http://www.coincommunity.com/forum.asp" & query

    %>

    so if you went to http://www.bobby131313-trading-assi....&moreinfo=blah

    then it would capture all request.querystrings, and send them to the new one, so it would turn out like this http://www.coincommunity.com/forum.a...&moreinfo=blah

    Then the new page can deal with any page not found issues.

    Let me know how it works

    Gav


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
  •