Lots of bad links

Discussion in 'Forum Support' started by Whaturmuva, Jul 8, 2008.

  1. Whaturmuva

    Whaturmuva Eating the souls of children

    Joined:
    Sep 27, 2002
    Messages:
    1,149
    Likes received:
    0
    Trophy points:
    36
    So I've noticed that at least in the Warcraft sections (probably more), most of the stickies full of links are well.....useless. The links in the stickies are all outdated and either send you to a bad page or just redirect to the main page.

    I suggest that the links are located (I assume in the archive) or just ditch the stickies all together because I'm sure guests do not enjoy having dead links because that would definitely make me not want to join if the information I wanted was not available.

    Anyways just wanted to point this out to try and be helpful :deadhorse:
     
  2. ChrisH36

    ChrisH36 Guy with Most Posts on Quiet Board.

    Joined:
    May 20, 2003
    Messages:
    15,042
    Likes received:
    4
    Trophy points:
    0
    From:
    Temple Prime, Sarajevo
    The thing is that some of the guides are fine. Just what happened was when the server was transferred, the HTML setup for the documents changed. I totally forgot about them until now.


    Anyways, half the links are fixed. And the outdated ones are removed from the sticky. My orc one is almost done, I just need to actually sit down and continue with it.
     
  3. x42bn6

    x42bn6 Retired Staff

    Joined:
    Nov 11, 2002
    Messages:
    15,150
    Likes received:
    2
    Trophy points:
    38
    From:
    London, United Kingdom
    The redirecting isn't really done smartly but it's difficult as the previous URLs didn't encode the forum in them - i.e. they were similar to showthread.php?threadid=696969, while the new schema thanks to vBSEO has /forum-name/696969-your-favourite-sex-position.html. The prefixing of /forums isn't so much of a problem.

    I think I might have found a better way, though, stay tuned...

    [edit] Yeah, I think I have it - I think we simply have to rewrite ./showthread.php and ./postreply.php (and any link without /forums in it) with, say, ./forums/showthread.php, passing all the $_GET and $_POST information through PHP. Such things shouldn't be that hard.

    [edit] Yeah, I think I might have conked something up. It's a .htaccess directive:

    Code:
    Redirect 301 /showthread.php http://www.battleforums.com/forums/showthread.php
    Redirect 301 /newthread.php http://www.battleforums.com/forums/newthread.php
    One line each for every broken file.

    I don't have my own webspace so I couldn't test it. The reason we can't use:

    Code:
    Redirect 301 / http://www.battleforums.com/forums/
    is because it will end up in an infinite loop. However, there are only a couple of files to redirect in vBulletin.

    This should also pass on any $_GET information. There's no need to pass on any $_POST information, I believe; it's not related to links.

    The only thing I couldn't figure out to do is the fact that it doesn't respect the active domain - i.e. http://battleforums.com/showthread.php will redirect to http://www.battleforums.com/forums/showthread.php breaking cookies. I suspect it's not a good idea to redirect non-www. URLs to www. URLs as it confuses search engines. This can be fixed by employing a more complicated regular expression but without a web server, I don't want to try.

    And of course, I hope kinkarso doesn't just stuff those lines in and hope for the best.*
     
  4. kinkarso

    kinkarso ex-admin

    Joined:
    Nov 19, 2007
    Messages:
    836
    Likes received:
    0
    Trophy points:
    0
    From:
    Vancouver, BC
    The thing is, forums/showthread.php doesn't seem to work. If you just add a /forums/ in front of the broken links, it doesn't exactly redirect you to the new vBSEO version of the URLs. I'm pretty sure anyways.
     
  5. x42bn6

    x42bn6 Retired Staff

    Joined:
    Nov 11, 2002
    Messages:
    15,150
    Likes received:
    2
    Trophy points:
    38
    From:
    London, United Kingdom
    No, the problem is that previous URLs looked like:

    http://www.battleforums.com/showthread.php?t=23

    or

    http://www.battleforums.com/showthread.php?threadid=23

    We simply need to pump up a /forums into the URL and those .htaccess directives should do that.

    I assume you have console access, so navigate to the root (/var/www - I don't know where you put all your stuff), and run this:

    Code:
    touch zomg.php
    chmod 755 zomg.php
    cd forums
    touch zomg.php
    chmod 755 zomg.php
    Then put this into .htaccess:

    Code:
    Redirect 301 /zomg.php http://www.battleforums.com/forums/zomg.php
    Then http://www.battleforums.com/zomg.php should redirect with HTTP 301 to http://www.battleforums.com/forums/zomg.php. Then it should work with all GET variables (try and see what http://www.battleforums.com/zomg.php?zomg=zomgzomgzomg redirects to).

    And, of course, remove those dummy files afterwards:

    Code:
    rm zomg.php
    cd forums
    rm zomg.php
    *
     
  6. kinkarso

    kinkarso ex-admin

    Joined:
    Nov 19, 2007
    Messages:
    836
    Likes received:
    0
    Trophy points:
    0
    From:
    Vancouver, BC
    Looks like that did it. Thanks
     
  7. x42bn6

    x42bn6 Retired Staff

    Joined:
    Nov 11, 2002
    Messages:
    15,150
    Likes received:
    2
    Trophy points:
    38
    From:
    London, United Kingdom
    HOLY COW IT ACTUALLY WORKED

    < Smart*
     
  8. Darkmatter

    Darkmatter Battle God

    Joined:
    Jul 16, 2004
    Messages:
    12,994
    Likes received:
    4
    Trophy points:
    0
    From:
    Palmdale
    More like nerd. :]

    Or robot. But you're my robot hero.

    Also, most of the stickies are outdated content wise, and patch wise. We can easily update them if the mods/smods kick in some help for the sections.
     
  9. ChrisH36

    ChrisH36 Guy with Most Posts on Quiet Board.

    Joined:
    May 20, 2003
    Messages:
    15,042
    Likes received:
    4
    Trophy points:
    0
    From:
    Temple Prime, Sarajevo
    vB removed using a Query String, so they changed the HTML Setup to accomondate for these changes.

    The Neutral hero ones I wrote are fine, since there were no changes to these units as of the patches I wrote them in. The Tinker one is really a discussion thread that people can contribute too (at the time, me and Revelade liked using that UU hero). We are now at 1.22 for Wc3.

    The only real unit that recieved a major change was the Knight. Got 3 base damage and .1 seconds cut off its attack speed. Guides need to be rewritten, either by someone who plays Wc3 a lot of that race, or by members who want to do it.