[Nottingham] Apache2 query string append onto a 404 response...

Martin martin at ml1.co.uk
Tue Jan 15 11:54:54 UTC 2013


Folks,

Calling any experts out there...

I'm trying to patch over some poor php for the nlug events calender that
causes the Google bot (and all others) to loop ad-nauseum forever into
the past and the future... The poor php jumps from 2018 back to 2008 and
vice-versa when clicking through the next links. Hence the forever
looping of the bots.

I've killed that forever looping with a:

RewriteRule
^/(category/)?events/.*(([013-9][0-9]{3})|(2[1-9][0-9]{2})|(20((0[0-7])|(19)|([2-9][0-9]))))-[0-9]{2}/?$
- [R=404,L]


Next is the same but for when search strings are used:

RewriteCond %{QUERY_STRING} !^$
RewriteCond %{QUERY_STRING}
EventJumpToYear=(([013-9][0-9]{3})|(2[1-9][0-9]{2})|(20((0[0-7])|(19)|([2-9][0-9]))))
RewriteRule . - [R=404,QSA,L]

which is all well and good.

However, that last one strips off the search string and so the 404
suggests the search page itself is the 'not found'...


What's the magic to list the search string with the 404 response?

Other than patching the php, are there any better tricks?


(Hopefully, getting rid of the loopy bots might speed up the site a bit!)

Cheers,
Martin

-- 
- ------------------ - ----------------------------------------
-    Martin Lomas    - OpenPGP (GPG/PGP) Public Key: 0xCEE1D3B7
- martin @ ml1 co uk - Import from   hkp://subkeys.pgp.net   or
- ------------------ - http:// ml1 .co .uk/martin_ml1_co_uk.gpg



More information about the Nottingham mailing list