Make vBulletin return a valid 404?

Discussion in 'vBulletin Discussions' started by Dan Hutter, Sep 5, 2012.

  1. Dan Hutter

    Dan Hutter aka Big Dan

    Joined:
    Jul 20, 2006
    Messages:
    1,412
    Likes Received:
    515
    Location:
    New York
    Hi Guys,

    I posted on the vB.com forums and even opened a support ticket both have been fruitless. Does anyone know how to make vBulletin 4 return a valid 404? I've tried using the htaccess error document directive and that doesn't work. All vB returns is a soft 404 'invalid thread specified'.

    Thanks,
    Dan
     
  2. Cerberus

    Cerberus Admin Talk Staff

    Joined:
    May 3, 2009
    Messages:
    1,031
    Likes Received:
    500
    What do you mean a valid one? You want a custom one? And does your site have a CPanel? You can just change it in there
     
  3. digitalpoint

    digitalpoint Regular Member

    Joined:
    Jul 9, 2012
    Messages:
    193
    Likes Received:
    313
    Location:
    San Diego, California
    Make a plug-in at the hook location error_generic with the following code:

    PHP:
    if (substr($errormessage019) == 'No Thread specified'header('HTTP/1.1 404 Not Found');
    Obviously would only work if the error message being thrown starts with "No Thread specified" (so wouldn't work with translations and such).
     
  4. Dan Hutter

    Dan Hutter aka Big Dan

    Joined:
    Jul 20, 2006
    Messages:
    1,412
    Likes Received:
    515
    Location:
    New York
    vBulletin is returning a soft 404 according to Google. 404 isn't in the header. cPanel's custom 404 won't work because vBulletin is not actually returning a 404 message. It's a standard page that says invalid thread specified.

    Many thanks Shawn this should work!
     

Share This Page