vBulletin 4, the most powerful community software + vBSEO 3.5, the ultimate SEO solution = Your ultimate platform for 2010 and beyond. Click below to learn more.

Results 1 to 6 of 6

Issue with htaccess and redirecting query strings

This is a discussion on Issue with htaccess and redirecting query strings within the General Discussion forums, part of the vBulletin SEO Discussion category; Hi all, need some help from some experts if you please... I had a script that created a load of ...

  1. #1
    Senior Member Dave Hybrid's Avatar
    Real Name
    Dave Hybrid
    Join Date
    Mar 2007
    Location
    UK
    Posts
    372

    Issue with htaccess and redirecting query strings

    Hi all, need some help from some experts if you please...

    I had a script that created a load of thread urls with either;

    ?hl=

    or

    ?-l=

    on the end of them.

    eg; [http:]//www.computer-juice[dot]com/forums/f10/acronyms-4474/?hl=bg

    I have now dropped the script but need to 301 these to a 404 as they are now causing duplicates.

    Thank you.

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    24,550
    Hello Dave,

    you can add this in .htaccess right after "RewriteEngine on":
    Code:
    RewriteCond %{QUERY_STRING} (hl=|-l=)
    RewriteRule (.*) http://www.computer-juice.com/forums/$1 [L,R=301]
    
    Oleg Ignatiuk / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


  3. #3
    Senior Member Dave Hybrid's Avatar
    Real Name
    Dave Hybrid
    Join Date
    Mar 2007
    Location
    UK
    Posts
    372
    Hi Oleg, that seems to stop the pages loading altogether.

    I added it to the /forums/ htaccess.

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    24,550
    Try to add "?" in the second line:
    Code:
    RewriteRule (.*) http://www.computer-juice.com/forums/$1? [L,R=301]
    
    Oleg Ignatiuk / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


  5. #5
    Senior Member Dave Hybrid's Avatar
    Real Name
    Dave Hybrid
    Join Date
    Mar 2007
    Location
    UK
    Posts
    372
    Perfect, that redirects to the original thread url.

    Thank you so much, you never fail.

  6. #6
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    24,550
    You are welcome!
    Oleg Ignatiuk / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


Similar Threads

  1. vbSEO - Query strings and under the hood
    By mreyes in forum General Discussion
    Replies: 1
    Last Post: 12-05-2008, 02:38 PM
  2. .htaccess issue
    By Cos in forum Troubleshooting
    Replies: 2
    Last Post: 02-28-2008, 04:41 AM
  3. htaccess query
    By requiem2d in forum General Discussion
    Replies: 1
    Last Post: 01-06-2008, 04:53 PM
  4. removing query strings...
    By Slingblade61 in forum URL Rewrite Settings
    Replies: 2
    Last Post: 11-21-2007, 03:41 PM
  5. Stripping strings from url
    By Noodles in forum General Discussion
    Replies: 4
    Last Post: 01-07-2006, 06:07 PM