jnich05 Posted July 7, 2011 Share Posted July 7, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/241297-server-choking-on-long-error-urls-redirect-off/ Share on other sites More sharing options...
cags Posted July 7, 2011 Share Posted July 7, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/241297-server-choking-on-long-error-urls-redirect-off/#findComment-1239782 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.