Jump to content

.htaccess Forbidden


Cod-nes

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
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...