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
    400
    Liked
    8 times

    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
    25,689
    Liked
    157 times
    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.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Senior Member Dave Hybrid's Avatar
    Real Name
    Dave Hybrid
    Join Date
    Mar 2007
    Location
    UK
    Posts
    400
    Liked
    8 times
    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
    25,689
    Liked
    157 times
    Try to add "?" in the second line:
    Code:
    RewriteRule (.*) http://www.computer-juice.com/forums/$1? [L,R=301]
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  5. #5
    Senior Member Dave Hybrid's Avatar
    Real Name
    Dave Hybrid
    Join Date
    Mar 2007
    Location
    UK
    Posts
    400
    Liked
    8 times
    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
    25,689
    Liked
    157 times
    You are welcome!
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


Similar Threads

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

Posting Permissions

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