Forum Moderators: phranque
[example.com...]
I wish to catch the "?" part, as there might be other combinations of characters after it that i don't want. In fact, i don't want that option to return anything but "Gone". I've tried a few things already, none works:
(1)
RewriteCond %{REQUEST_URI} ^/\? [NC]
RewriteRule .* - [G] (2)
RewriteCond %{REQUEST_URI} \? [NC]
RewriteRule .* - [G] (3)
RewriteCond %{REQUEST_URI} ^\? [NC]
RewriteRule .* - [G] (4)
RewriteRule ^/\? - [G] (5)
RewriteRule ^\? - [G] (6)
RewriteRule \? - [G] Any ideas? Pointers?
/claus
Is it that Apache thinks you've got a query string after the '?' and moving the rest of the string from %{REQUEST_URI} into %{QUERY_STRING}?
I've used 'RewriteCond %{QUERY_STRING} !^$' and 'RewriteCond %{QUERY_STRING} ^(<some string>)$' to detect query strings before, because in a per-directory .htaccess context, Apache strips it out of %{REQUEST_URI} and it's not directly accessible in RewriteRule. The '?' itself is never 'visible' unless you use %{THE_REQUEST}.
Jim
------------------------------------------------------
RewriteCond %{QUERY_STRING} !^$
RewriteCond %{REQUEST_URI} !^/some-folder/ [NC]
RewriteRule .* - [G] :)/claus
But...serving Googlebot a 410 for [example.com...] is definitely not a good idea, as it will show as if it was the domain that served a 410 (without the searchstring)...
I can't redirect 301 or 302 to the domain without the searchstring, as then the rule loops. Can't really 403 forbid it either, as this will also be interpreted as being done at the root...
My only option seems to make my index page a script in stead of a page, or redirect it internally to some appropriate location not equal to the index page.
[edited by: jdMorgan at 12:58 am (utc) on Dec. 2, 2003]
[edit reason] Corrected missing spaces [/edit]
Now i'm waiting, i hope they can sort it out. I suppose they are busy with the Florida update at the moment, so i'm not expecting anything fast.
/claus