This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
HotlinkBlocker (Forum Locked Forum Locked)
 Helicon Tech : HotlinkBlocker
Subject Topic: Redirect all .php & .cgi requests (Topic Closed Topic Closed)
Author
Message |
superwebs
Groupie


Joined: 12 December 2003
Location: United Kingdom
Posts: 46
Posted: 29 June 2009 at 3:18am  

I would like to redirect all .php and .cgi requests to a single file.

How can I do this?

I'm using v2.
Back to Top Visit superwebs's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 30 June 2009 at 8:09am  

You are probably using ISAPI_Rewrite 2 product?
Then could you please explain what does "single file" mean. Give a specific example of requested URL and the way it should be processed.

__________________
Regards,
Anton
Back to Top
 
superwebs
Groupie


Joined: 12 December 2003
Location: United Kingdom
Posts: 46
Posted: 30 June 2009 at 8:23am  

I want to just redirect all requests to .php or .cgi files to php-error.htm

Our weekly PCI scan is trying to access vulnerable files like this:

https://domain.com//install.php?newlang=../../cpg_error.log%00

Although we don't have PHP running for the domain IIS still seems to try and process these requests. I would like to simply redirect them to a static error page.
Back to Top Visit superwebs's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 01 July 2009 at 1:55am  

Ok, please try to use the following rule:

RewriteBase /
RewriteRule ^.*\.(?:php|cgi)$ php-error.htm? [NC,R=301,L]

__________________
Regards,
Anton
Back to Top
 
superwebs
Groupie


Joined: 12 December 2003
Location: United Kingdom
Posts: 46
Posted: 01 July 2009 at 3:08am  

This is giving me a 404 error. The php-error.htm page is definitely in the root of the site.
Back to Top Visit superwebs's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 01 July 2009 at 5:22am  

Please enable logging and provide rewrite log records for the specific request.

__________________
Regards,
Anton
Back to Top
 
superwebs
Groupie


Joined: 12 December 2003
Location: United Kingdom
Posts: 46
Posted: 01 July 2009 at 5:46am  

I'm not 100% sure how to enable logging.

I added "LogLevel debug" to my httpd.ini file and got the following:

Line 4: Unrecognized string: LogLevel debug
Line 15: Unrecognized string: RewriteBase /
Line 16: Unrecognized string: RewriteRule ^.*\.(?:php|cgi)$ /php_redirect.htm? [NC,R=301,L]
Back to Top Visit superwebs's Homepage
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum