Cod-nes Posted July 15, 2009 Report 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 Report 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 Report 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 Report 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 Report 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 Report Share Posted July 20, 2009 (edited) 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 July 20, 2009 by Cod-nes Link to comment Share on other sites More sharing options...
bOtskOOl Posted July 24, 2009 Report 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
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 accountSign in
Already have an account? Sign in here.
Sign In Now