scandalous scandalous - 4 months ago 23
Apache Configuration Question

htaccess redirect with question mark

Hello I'm trying to redirect

/fr/welterweight.php
which is a local folder on my website via apache conf or .htaccess.

To
http://www.bluek.com/fr/welterweight.php?c=france
which is another website I own.

I tried

RewriteCond %{REQUEST_URI} /fr/welterweight.php
RewriteCond %{QUERY_STRING} ^welterweight.php$
RewriteRule ^/?$ http://www.bluek.com/fr/welterweight.php?c=france


But its not working

Answer

This rule should work from site root .htaccess:

RedirectMatch 302 ^/fr/welterweight\.php$ http://www.bluek.com/fr/welterweight.php?c=france

There is no need to match for QUERY_STRING as you original URL doesn't have any query string.

Comments