This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions (Forum Locked Forum Locked)
 Helicon Tech : Common Questions
Subject Topic: need help with a rewiter rule
Author
Message |
bwnbwn
Newbie


Joined: 18 October 2006
Posts: 10
Posted: 10 May 2010 at 10:26am

I need some advice here. I have searched till I am at a loss. I am trying to make this url a 404 www.example.com/products/?q=anything from being a live url for duplicate content reasons or www.example.com/?q=something from being a live url 

I do not have any rewritten url's they are all static .htm pages

The site is a static site except for my search fuction. The search is something like this www.example.com/search.asp?searchterm=search term

When I tested the ?q=something all my url's will throw a 200 so I have looked for a solution. I tested some of the coding given but it won't work for my site. Any suggestions would be greatly appreciated.

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 11 May 2010 at 4:13am

Ok, let me clarify a bit.
Do you need to redirect either www.example.com/products/?q=anything or www.example.com/?q=something to 404 error page?

__________________
Regards,
Anton
Back to Top
 
bwnbwn
Newbie


Joined: 18 October 2006
Posts: 10
Posted: 11 May 2010 at 8:38am

Anton wrote:
Ok, let me clarify a bit.
Do you need to redirect either www.example.com/products/?q=anything or www.example.com/?q=something to 404 error page?

Sorry for the bad post I wasn't thinking.

here is the issue. I have Helicon installed on the server Isapi-rewrite3. I use it for several basic fuctions 301's and several other applications but no url rewrites.

This is a static .htm site. I am an SEO and have been reading that people doing black hat seo are linking to sites using the above against them from duplicate content.

Right now on my site if I add the ?q=keyword-keyword

or

?q=something

this throws a server header 200.This makes this live page/s and can have negative effects on SEO.

So yes I want it to throw a 404 I have a custom 404 page built and use IIS to direct the user to the custom 404 page.

I do want to add I have a search fuction on the site that uses

http://www.example.com/search.asp?searchterm=anything that I do not need to mess with in the rewrite rule.

I hope my more detailed post will help in finding a way to get this done.

Thank you very much,

Joseph

Back to Top
 
bwnbwn
Newbie


Joined: 18 October 2006
Posts: 10
Posted: 11 May 2010 at 8:42am

Sorry for the add I have the non www already redirected back to the www so the non www isn't needed in the rule.

http://www.google.com/?q=something is a good example

http://www.helicontech.com/?q=something another one this is the exact thing I need.

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 12 May 2010 at 2:16am

Please try to use smth like this:

RewriteBase /
RewriteCond %{QUERY_STRING} ^(?!searchterm=.+).+$ [NC]
RewriteRule .* custom404.htm? [R=301,L]

__________________
Regards,
Anton
Back to Top
 
bwnbwn
Newbie


Joined: 18 October 2006
Posts: 10
Posted: 12 May 2010 at 8:06am

Thank you very much that is a fix.
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum