Jump to content

Server Choking on long error urls. redirect off?


jnich05

Recommended Posts

Googlebot is somehow crawling some extremely long urls on my server like:

 

http://website.com/<br /><b>Notice</b>:  Undefined variable: content_type in <b>/home/webuser/helloworld/htdocs/include/page_tag.php</b> on line <b>620</b><br />http://website.com/rss/rss_tags?item=links&type=&tag=room

 

I have no idea how these urls are being created, but each time they are viewed, it maxes out my memory and CPU for a good 10+ minutes. I'm thinking that my various .htaccess redirects are getting stuck somewhere in a loop to cause this.

 

I'd like to redirect all these bad urls to my homepage, and have tried to detect/redirect them with:

RewriteCond %{REQUEST_URI}    ^/(,|;|:|<|>|">|"<|/|\\\.\.\\).{0,9999}.* [NC,OR]

 

It seems to work with short urls, but when the urls get super long, it still crashes my site.

 

Anyone have ideas of how I could redirect these without doing too much processing?

You could try simply forbidding any request for a file that doesn't exist. Depending on whether you are actually using redirect as part of your web application though this could present problems. If you are not, then something like...

 

RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [F] 

 

... may work. I'm not sure if it will prevent your server crashing. If you need redirect rules, then you should be able to accommodate them, but we'd need to see them to have any clue of how to fix the issue.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.