Clash of 2 .htaccess files?

Hi,

  1. I have an .htaccess file in my root for rewriting urls.

  2. I also have one in my administration directory which was to deny access to all IPs, except one.

However, running the second one gives me a 500 Internal Server Error.

The code is something like this, but with a different IP(not mine)…


Order Deny,Allow
Deny from 41.288.29.102

Is there an obvious reason why this may be happening?
The page loads fine when I remove the .htaccess file.

Many thanks

i2,

Yes, the Order directive is applied to (withIN) a <Directory> or <File> block.

Regards,

DK

Hi dklynn,

Thanks for the reply.

Can you show me how I would achieve this for my folder?
Would the htaccess in my root store the Order Deny, Allow?

Thanks again

i2,

<Directory>
Order allow,deny
Deny from 41.288.29.102
</Directory>

Regards,

DK

Thanks for the reply dkylnn.

Just to double-check this would go in the ‘admin’ directory, yes?

i2,

If that is the directory which is banning 41.288.29.102, then yes.

Regards,

DK

Thank you. Will let you know how I get on with this :slight_smile:

Strange. I’m still getting a 500 Error :frowning:

In my administrator directory I’m using:


<Directory>
Order allow,deny
Deny from all
Allow from my.ip.goes.here
</Directory>

Do you need me to post my root .htaccess code, in case there’s a conflict?

I tried a simple Redirect statement with htaccess, which works. But this doesn’t :frowning:

Thanks again dk for any help.