Jump to content

.htaccess deny from all doesn't work


Jurist

Recommended Posts

Hello,

 

How to properly edit .htaccess for subdomain to make it allow connections only from specific ip addresses?

 

when I add:

 

Order Deny,Allow
Deny from all
Allow from xx.xxx.xxx.xx
Allow from xx.xxx.xxx.xx
 
only part of website is blocked.
 
I have test site in:
 
sub.mydomain.com
 
and it reads part of code from production store which is on:
 
www.mydomain.com
 
How do I make every resource loaded from www.mydomain.com be first redirected to sub.mydomain.com and then be checked for permissions?
 
I think I should add condition which redirects no matter what, www or nonwww http or https to https://sub.mydomain.com
This should also resolve problem with redirect chains. 
 
I will appreciate any reply. 
 
Link to comment
Share on other sites

  • 2 weeks later...

Okay so I've managed to sort this out: 

 

My php interpreter was cgi and I needed to install FPM to make .htaccess rules actually work. 

After installing proper package and switching site to use FPM .htaccess deny allow works as intended.

 

Hope that helps anyone.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...