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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.