Forum Moderators: phranque

Message Too Old, No Replies

How to ban dynamic url,contains *.php references?

         

Yvoinov

7:04 pm on Mar 20, 2008 (gmt 0)

10+ Year Member



Hi guys,
I need some help.

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]

jdMorgan

7:32 pm on Mar 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In both cases, your start-anchor is the main problem. See the regular-expressions tutorials cited in our forum charter and in our forum library.

The pattern should not be start-anchored, and [F] implies [L], so [L] is redundant:


RewriteRule \.php$ - [F]

If you have any intentions of growing this site or doing marketing with it, I would urge you to get a 'regular' hosting account before investing any more time in it: You will never get good search engine rankings with a hosting set-up such as you describe here.

Jim

Yvoinov

3:38 am on Mar 21, 2008 (gmt 0)

10+ Year Member



Jim,
thank You for explanation. Some details.

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.

g1smd

8:35 pm on Mar 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That 302 redirect will come back to haunt you again and again and again.