Forum Moderators: phranque
I need to ban dynamic URL (witn ANY php references, i.e. server contains NO php code) looks like:
http://www.example.com/clickfraud.php?click=1
The problem are:
The domain is redirected with 302 from DirectDNS from http://www.example.com/ to real URL:
http://www.example.com/pls/f?p=335:1
and, after all, resulting URL is:
http://www.example.com/pls/f?p=335:1/clickfraud.php
So, my server application return code 200.
I need to return 403,404 or something like that.
But when I wrote some mod_rewrite conditions, i.e.:
RewriteCond %{THE_REQUEST} ^.php$
RewriteRule .* - [F,L]
and the similar constructions (including RewriteRule ^/?pls/f$ - [F,L]), they doesn't work.
The question is:
How to correctly ban only any php requests to this dynamic server?
[edited by: jdMorgan at 3:51 am (utc) on Mar. 21, 2008]
[edit reason] example.com [/edit]
The pattern should not be start-anchored, and [F] implies [L], so [L] is redundant:
RewriteRule \.php$ - [F]
Jim
This server contains two applications on one static IP. First, server is completely dedicated and co-located on ISP. Second, primary business application is directly accessed via DirectDNS, linked with primary static IP.
The application I mean is non-commercial technology forum, written on Oracle Application Express. So, I've not get second static IP for it (it so expensive in my country) and uses "No frame redirect" (with 302 redirection) feature of DirectNIC.
But if first site is good indexing with Yahoo, and Google, the second (forum) has permanently problem with only indexing some trash links with php-requests. Note - no PHP code contains on both servers.
Both applications use the same instance of Apache.
So, I need to block any PHP request to the secondary application. They added by Google at the end of dynamically generated URLs and produces application (not Apache) error with HTTP header code 200.