Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

205
Visualizações
Use htaccess to restrict by IP, but unrestrict one directory

I am trying to restrict access to a domain to one IP address, but allow anyone to access one directory within that domain. So I have this in my .htaccess (in web root):

<RequireAll>
    Require ip xx.xx.xx.xx
</RequireAll>

which is working great to restrict access, but then when I want to allow unrestricted access to /folder within the root, so I tried:

<Directory "/home/*/public_html/folder">
 Allow from All
 Satisfy Any
</Directory>

but then I get a 500 error. So how would I accomplish this? And why the 500?

Also, for reference, here's the rest of the htaccess, which routes all requests to the index.php

# Remove ".php" from path
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

Options +FollowSymLinks

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d

RewriteRule ^.*$ ./index.php

Thanks!

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda