We help IT Professionals succeed at work.

301 redirect not working in .htaccess how do I?

417 Views
Last Modified: 2012-05-11
I am trying to do a redirect in htaccess but the rule is being ignored.
redirect 301 /index.php?pid=12 http://www.illumitex.com/

I know it works bc I have this code and it redirect the domain to www:
RewriteCond %{HTTP_HOST} !^www\.illumitex\.com [NC]
RewriteRule ^(.*)$ http://www.illumitex.com/$1 [R=301,L]


What I am trying to do is force some spacific older pages back to the main index page or just / .

I have also  tried:
rewriterule index.php?pid=165 http://www.illumitex.com/ [R=301,L]
But that is not working either.
What am I doing wrong?

Comment
Watch Question

Commented:
A question mark is a special character that should be escaped:
index.php\?pid=12
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.