We have a url like this:
http://www.testurl.com/?in=what-do-pills-do
It's not damaging us, but how do I make a URL that doesn't exist, with that ?in=***** redirect to our homepage instead?
In theory, I can set a variable called $in, and redirect it. But what stops them doing ?out-.......
Also, how do I identify within my code if the site is within a scraper, which looks like an iframe - and redirect them?
How do I stop scrapers, and /?=hello urls?
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
How do I stop scrapers, and /?=hello urls?
Last edited by pickle on Fri May 24, 2013 5:09 pm, edited 1 time in total.
Reason: Removed "viagra" keyword that was causing "grilled spam", as well as note referencing the replacement
Reason: Removed "viagra" keyword that was causing "grilled spam", as well as note referencing the replacement
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: How do I stop scrapers, and /?=hello urls?
Can I query in the URL if there is "/?" ??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: How do I stop scrapers, and /?=hello urls?
The only thing that knows whether the URL "exists" is your code. Do whatever it takes to determine if that in value is valid, and if not redirect.
Don't know what "query in the URL" means.
Breaking out of frames is done with Javascript. IIRC something like
Don't know what "query in the URL" means.
Breaking out of frames is done with Javascript. IIRC something like
Code: Select all
<script type="text/javascript">
if (window.top != window) {
window.top.location = window.location;
}
</script>Re: How do I stop scrapers, and /?=hello urls?
You can test if a non-empty query string exists in PHP using
But in general a good bot scraper can mimic a browser and you'll have a difficult time stopping them.
Code: Select all
if(!empty($_GET)) {
//do something because there is a query string
}