httpd.conf redirect query

Discussion in 'Apache' started by Deadsquirrel, Feb 7, 2012.

  1. #1
    Hi all, I need some help with a redirect problem i have.

    We have just completed a redesign of our site and as a result we have about 500 redirects to carry out. Worried about doing that in .htaccess, I decided that as i have a dedicated server for this site so full control over it, that it would be better to do the redirect in httpd.conf which only gets compiled once at startup.

    So, to begin with, im trying to get a single redirect to work but cant seem to do it.

    The .htaccess redirect that im trying to transfer to httpd.conf is:

    RewriteCond %{QUERY_STRING} ^page=1&c1=Indoor&c2=blue%20widgets$
    RewriteRule ^shop/shop.php$ http://www.example.co.uk/shop/shop.php?c1=Indoor&c2=long-blue-widgets [L,R=301]


    I placed the following line at the end of the httpd.conf file to try and duplicate the same behaviour as the above .htaccess redirect.

    RewriteRule ^/shop/shop.php?page=1&c1=widgets&c2=blue%20widgets$ /shop/shop.php?c1=widgets&c2=long-blue-widgets

    Any ideas of why that does not work? do i need to wrap it in a <directory? directive like i read somewhere? How exactly would i do that?

    Any help will be appreciated. If there are any experts there who can assist with this i dont mind paying and agreed price.

    Speak soon,
    DS
     
    Last edited: Feb 7, 2012
    Deadsquirrel, Feb 7, 2012 IP