SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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)...
    Code:
    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

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    i2,

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

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    i2,
    Code:
    <Directory>
    Order allow,deny
    Deny from 41.288.29.102
    </Directory>
    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply dkylnn.

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

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    i2,

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

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. Will let you know how I get on with this

  8. #8
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Strange. I'm still getting a 500 Error

    In my administrator directory I'm using:

    Code:
    <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


    Thanks again dk for any help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •