User login

Stop abusing my old CCK / Views calendar, internet! A quick and dirty how-to

It was simply constant.


Mar 6 06:47:35 server1 drupal: http://example.com|1267879655|php|0|216.129.119.40|http://example.com/calendar/4/1/2009/04/20|||Invalid argument supplied for foreach() in /sites/example/www/includes/tablesort.inc on line 187.
Mar 6 06:47:35 server1 drupal: http://example.com|1267879655|php|0|216.129.119.40|http://example.com/calendar/4/1/2009/04/20|||Invalid argument supplied for foreach() in /sites/example/www/includes/theme.inc on line 769.
Mar 6 06:47:49 server1 drupal: http://example.com|1267879669|php|0|209.6.110.26|http://example.com/calendar/4/10|http://example.com/calendar/10/27/1/4||Invalid argument supplied for foreach() in /sites/example/www/includes/tablesort.inc on line 149.

Those three errors over and over and over again. All caused by invalid URLs that i sure as heck couldn't find any way to navigate to. So instead of trying to fix Drupal 5 Views 1 era calendar code, we'll just send the lost bots or extremely lost souls on their way-- to the main calendar page, which has no errors. (Nor do any of the expected calendar/2010/

Inside the mod rewrite directive:

<IfModule mod_rewrite.c>
  RewriteEngine on

Right under the (unused, commented-out) RewriteBase rule:

  RewriteRule ^calendar/([0-9]{1,2})/.+$ /calendar [NC,R=301,L]

And that took care of that clutter in our log!

Searched words: 
non-valid invalid URLs somehow hit in /calendar of Drupal 5 CCK Views triggering constant foreach errors apache rewrite rule if digits mod rewrite

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.