Cod-nes Posted July 15, 2009 Share Posted July 15, 2009 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 More sharing options...
justsomeguy Posted July 15, 2009 Share Posted July 15, 2009 You can add a rule in htaccess to send a 403 response if the URL matches the one you're looking for. Link to comment Share on other sites More sharing options...
bOtskOOl Posted July 16, 2009 Share Posted July 16, 2009 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 More sharing options...
NurAzije Posted July 16, 2009 Share Posted July 16, 2009 Try something like this:<Directory /url>Order allow,denyDeny from all</Directory> Link to comment Share on other sites More sharing options...
justsomeguy Posted July 16, 2009 Share Posted July 16, 2009 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 More sharing options...
Cod-nes Posted July 20, 2009 Author Share Posted July 20, 2009 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 More sharing options...
bOtskOOl Posted July 24, 2009 Share Posted July 24, 2009 So the .htaccess file would look like this?You are almost right It should be like this -order deny,allowdeny from allallow from www.sub.example.comallow from sub.example.com Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.