Help with a simple rewrite

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 11
Joined: 17 Aug 2015, 21:04

Help with a simple rewrite

29 Jul 2016, 03:37

Based upon really poor coding (unless these sites are doing it on purpose) I have found a number of sites have scraped Alexa and republished websites in countries such as New Zealand, Russia and others.

The problem is that they add a key to the domain, and then provide Google index a bad url causing a 404.

I refer to get rid of 404's as I see them and Helicon Isapi has always made this easy, however for some reason I am having trouble rewriting these particular urls.

An example is as follows, and sending it to / root is fine. I have full confidence that the great support here will provide the example I need.

http://domain.com/key/ASWD12345CSA

Thank you in advance, and I will state I love this product and always recommend it to others.

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: Help with a simple rewrite

04 Aug 2016, 07:17

Hello.

Sorry for late response.

According to what I see you need to filter everything that comes to your site and starts with '/key/' in the URL and redirect it to '/' (root page)? I suppose you don't have real URLs that starts with 'key'. Please use this rule:


RewriteRule $key/ / [NC,R=301]

User avatar
Posts: 11
Joined: 17 Aug 2015, 21:04

Re: Help with a simple rewrite

09 Aug 2016, 01:08

I gave that a try and that did not work.

So far I have tried
RewriteRule $key/ / [NC,R=301]
RewriteRule ^$key/ / [NC,R=301]
RewriteRule ^$key/$ / [NC,R=301,L]

No I do not have any folders named /key/ and I see this on a LOT of sites that Google shows as a 404 due to a few alexa scrapers in a few countries mostly in china and New Zealand but some show from a .ru version.

I tested from different browsers each time to make sure it was not a cache thing.

I was hoping to redirect this crap to the home page instead of disavowing the domains.

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: Help with a simple rewrite

09 Aug 2016, 13:34

Sorry, I made a mistake in the rule. Please try this instead:

RewriteRule ^key/ / [NC,R=301]

User avatar
Posts: 11
Joined: 17 Aug 2015, 21:04

Re: Help with a simple rewrite

13 Aug 2016, 03:37

Thank you very much that worked

I swore I had tried that one before I came here and posted the first time but it was not in my comments in the htaccess so I guess not. lol

Always good to have a fresh set of eyes especially when it is the helpful team here.

Thanks again

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 7 guests