Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17

vbseo not returning 404s for certain urls

This is a discussion on vbseo not returning 404s for certain urls within the Troubleshooting forums, part of the vBSEO SEO Plugin category; Hi, I have just replaced a SMF forum with Vbulletin. I am not too worried about redirecting all of the ...

  1. #1
    Junior Member
    Real Name
    LuckyStrike
    Join Date
    Feb 2008
    Posts
    24
    Liked
    0 times

    vbseo not returning 404s for certain urls

    Hi,

    I have just replaced a SMF forum with Vbulletin. I am not too worried about redirecting all of the urls from the old forum to the new vbulletin urls, apart from the main forum boards, which I have redirected using custom redirects.

    I would however like to give a 404 status for any old urls that I have not redirected. But it seems that most of the old urls do not return a 404 status code but redirect to the forum homepage.

    An example of an old SMF url is: http://forum.mydomain.com/index.php?board=1.0.html

    Is there anything I can do to make these urls return a 404?

    Thanks

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Hello,

    do you have "File not found" handler option in vBSEO CP set to "Send 404 code"?

  3. #3
    Junior Member
    Real Name
    LuckyStrike
    Join Date
    Feb 2008
    Posts
    24
    Liked
    0 times
    Hi,

    No, I have it set to 'include custom script'. and I have set up a custom vb 404 page.

    This all works well for certain types of urls... e.g http://forum.mydomain.com/this-is-a-bad-url.html will return a correct 404 status and display my custom 404 page. However the problem exists with the old smf urls that I gave an example of in my 1st post.

    Cheers

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Ahh, I see - old link points to the existing URL.

    You can put this in .htaccess file right after "RewriteEngine on" line:
    Code:
    RewriteCond %{QUERY_STRING} board=
    RewriteRule index\.php custom404.php [L]
    where custom404.php is the filename of your custom 404 handler script.

  5. #5
    Junior Member
    Real Name
    LuckyStrike
    Join Date
    Feb 2008
    Posts
    24
    Liked
    0 times
    Hi, no that doesn't work I am afraid.

    I have followed these instruction to set up the custom 404: Create a Custom vBulletin "404 Page Not Found" Page, and direct vBSEO to use it.

    And I added the following code to my htaccess in the root of my forum:

    Code:
    RewriteCond %{QUERY_STRING} board=
    RewriteRule index\.php 404.php [L]
    But the old smf urls still don't return a 404 and still just go to the front page of my forum.

    Could there possibly be something wrong with the code you gave me?

    Thanks for the help

  6. #6
    Junior Member
    Real Name
    LuckyStrike
    Join Date
    Feb 2008
    Posts
    24
    Liked
    0 times
    I have just tested the url on the vbseo forum and it has the same problem, the bad url redirects to the home page and doesnt return a 404:

    http://www.vbseo.com/forums/index.php?board=1.0.html

  7. #7
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    What is an example URL that doesn't work for you?

  8. #8
    Junior Member
    Real Name
    LuckyStrike
    Join Date
    Feb 2008
    Posts
    24
    Liked
    0 times
    Try this url: http://www.vbseo.com/forums/index.php?board=1.0.html

    As you can see it does not return a 404. I am having the same problem with my forum. I have a few hundred urls from my old forum in the same format that I need to generate 404s on my new vbseo'd forum.

  9. #9
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    We do not have the mentioned code in .htaccess (since we never had SMF installed and that URLs is not indexed in our case). Since there can be ANY parameters added to ANY URL, it's not possible to handle all of them automatically.

  10. #10
    Junior Member
    Real Name
    LuckyStrike
    Join Date
    Feb 2008
    Posts
    24
    Liked
    0 times
    Ok, fair enough. Do you know what code I could put in my htaccess to handle this url format?

    Thanks

  11. #11
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    The code above should work (I just tested it on my local dev instance).

  12. #12
    Junior Member
    Real Name
    LuckyStrike
    Join Date
    Feb 2008
    Posts
    24
    Liked
    0 times
    Hi Oleg, this code still doesn't work for me.

    Could it be that I have defined homepage aliases for index.php and index.php? in the vbseo control panel? What code can I use if this is the case?

    Thanks

  13. #13
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    What is your full .htaccess file contents now?

  14. #14
    Junior Member
    Real Name
    LuckyStrike
    Join Date
    Feb 2008
    Posts
    24
    Liked
    0 times
    My full htaccess is as follows. Note that my forum is installed in the root of a subdomain i.e http://forum.mydomain.com

    Also when posting my htaccess in this post for some reason it would not display the '\' in the 'index\.php'

    Code:
    # Comment the following line (add '#' at the beginning)
    # to disable mod_rewrite functions.
    # Please note: you still need to disable the hack in
    # the vBSEO control panel to stop url rewrites.
    RewriteEngine On
    
    # Some servers require the Rewritebase directive to be
    # enabled (remove '#' at the beginning to activate)
    # Please note: when enabled, you must include the path
    # to your root vB folder (i.e. RewriteBase /forums/)
    RewriteBase /
    
    #RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
    #RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]
    
    RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    
    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteCond %{REQUEST_URI} !(admincp/|modcp/|chat|cron)
    RewriteRule ^(.*\.php(/.*)?)$ vbseo.php?vbseourl=$1 [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif)$
    RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1 [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ vbseo.php?vbseourl=$1 [L,QSA]
    
    RewriteCond %{QUERY_STRING} board=
    RewriteRule index\.php 404.php [L]

  15. #15
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    As it is mentioned above, you should add the code right after "RewriteEngine on" line.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 03-25-2007, 04:23 AM
  2. 404s and SEO
    By majordude in forum General Discussion
    Replies: 1
    Last Post: 09-05-2006, 01:53 PM
  3. Discount for returning customers?
    By Mike in forum General Discussion
    Replies: 5
    Last Post: 05-26-2006, 06:26 PM
  4. 301 redirects from old mod_rewrite URLs to vbSEO URLs?
    By BigBlueBall in forum Custom Rewrite Rules
    Replies: 1
    Last Post: 12-30-2005, 08:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •