Jump to content

.htaccess Forbidden


Cod-nes
 Share

Recommended Posts

I didn't know where to put this but since this a server related file I decided to put this here. I have two urls (example #1: url.example.com example #2: example.com/url) but I don't one of them to be accessed (the folder). How can I do this?

Link to comment
Share on other sites

Hello Cod-nes,If you want to restrict access to a particular folder all together you can write a rule something like this in your .htaccess file -

order deny,allowdeny from all#allow from (mention here the domains from which you want to allow access)

Link to comment
Share on other sites

I don't think you really want to deny access to the directory, if the subdomain is pointing to that directory then people won't be able to access the subdomain. It sounds like you want to allow access as long as the URL uses the subdomain, right?

Link to comment
Share on other sites

Hello Cod-nes,If you want to restrict access to a particular folder all together you can write a rule something like this in your .htaccess file -
order deny,allowdeny from all#allow from (mention here the domains from which you want to allow access)

So the .htaccess file would look like this?
order deny,allowdeny from allallow from www.sub.example.com & sub.example.com
Edited by Cod-nes
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
 Share

×
×
  • Create New...