View Single Post
Old 01-05-2012, 09:22 AM   PM User | #11
devinmaking
Regular Coder

 
Join Date: Oct 2011
Posts: 236
Thanks: 11
Thanked 5 Times in 5 Posts
devinmaking has a little shameless behaviour in the past
Quote:
Originally Posted by leslie.jones View Post
Just adding to that, if you *really* want to do it (and for the sake of Google bringing people here):

The reason your version fails is because of the ? question mark ? You cannot use the question mark in the match as it signals a querystrings which is caught as separate data.

This basic example will do what you want for the specific URL quoted, but it can probably be better refined or optimised.
Code:
RewriteCond %{REQUEST_URI} ^/blog-article.php$
RewriteCond %{QUERY_STRING} ^id=14$ 
RewriteRule ^(.*)$ http://www.google.co.uk [R=301,L]
Hope that helps.
The only problem with this is you can only use this once.

i have 8 urls.

id=6 etc once, you have queried the blog once it does not allow you to do the same for others.
devinmaking is offline   Reply With Quote