Strip parameters from rewritten URL?

Discussion in 'Apache' started by costa580, Jan 30, 2009.

  1. #1
    Hello,

    We took over a site that had a large number of pages. We redid the site in Wordpress and condensed it to just a few pages.

    There are many URLs like this, all of which we just want to 301 redirect to the homepage:

    http://www.oursite.com/products/corp/apps/ecs/Servlet?pathinfo=%2Fgets%2FEntry.html

    I created a blanket statement like this:

    RedirectMatch 301 ^/products/.*$ http://www.oursite.com/

    The redirect works, however, instead of going to http://www.oursite.com/, it goes to: http://www.oursite.com/?pathinfo=/gets/Entry.html

    How can I strip variables like this from the rewritten URL?


    Entire htaccess follows:

    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    RedirectMatch 301 ^/link/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/products/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/topic/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/tracking/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/demos/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/czech_republic/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/external_media/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/internal_media/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/fweb/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/service_profiles/.*$ http://www.oursite.com/
    RedirectMatch 301 ^/subs/.*$ http://www.oursite.com/
    Redirect 301 /index_main.php http://www.oursite.com/
    Redirect 301 /Shipping_Freight.cfm http://www.oursite.com/
    
    Code (markup):
    Thanks for any assistance!
     
    costa580, Jan 30, 2009 IP