NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page .htaccess help

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
6 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 10-23-2005, 09:29 AM THREAD STARTER               #1 (permalink)
Senior Member
 
gamehouse's Avatar
Join Date: Sep 2005
Location: Montreal
Posts: 1,401
gamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to behold
 


Adoption

.htaccess help


Hi there,
I don't know if this has been asked before. I could not find a relavant post.

This is what I want to do.
I have a site mysite.com and I have a directory loocated at mysite.com/dir/

And other files on my site use lot of files from this directory calling items as mysite.com/dir/item1 and mysite.com/dir/item2 like that. This calling is done by php script and those results will be shown on the site.

Now how can I restrict anybody's access directly to mysite.com/dir/
Their purpose could be to download all the items one by one. I tried some code for .htaccess but it stopped complet access meaning my site could not show anything.
So in essense what I am looking for is help to protect a directory from direct access but at the same time my server or my site can access it.
????: NamePros.com http://www.namepros.com/code/134257-htaccess-help.html

I will offer 25NP if anybody can help me with this, please.

Thanks in advance,

Gameshouse
gamehouse is offline  
Old 10-23-2005, 09:51 AM   #2 (permalink)
NamePros Regular
 
nick's Avatar
Join Date: Jun 2004
Location: Iowa City
Posts: 703
nick has much to be proud ofnick has much to be proud ofnick has much to be proud ofnick has much to be proud ofnick has much to be proud ofnick has much to be proud ofnick has much to be proud ofnick has much to be proud of
 


Save The Children
Not sure if I follow what your asking but

why not just put a "index.html" into each directory?
__________________
formally ninedogger
------
Want to talk to a stranger? -->| Click Here | TalkToAStranger.com | <-- Meet New Friends
nick is offline  
Old 10-23-2005, 10:38 AM   #3 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 579
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




Can't you just set the permissions on the server
Encenta.com is offline  
Old 10-23-2005, 10:44 AM THREAD STARTER               #4 (permalink)
Senior Member
 
gamehouse's Avatar
Join Date: Sep 2005
Location: Montreal
Posts: 1,401
gamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to behold
 


Adoption
Okay, let me try to be more clear.

I want to deny direct access to a directory on my site but at the same time let my site itself access the contents of that directory. In otherwords, I want to forbid access to this directory for outsiders (but my site must be able to use the contents of this directory though)

How can I do that server permissions, I am little new in this.

Do you mean CHMOD? the what should I have, it is right now 0777
Please explain

Thanks,

gamehouse
Last edited by gamehouse; 10-23-2005 at 10:50 AM.
gamehouse is offline  
Old 10-23-2005, 11:03 AM   #5 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 579
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




Yeah, CHMOD. Try changing the permissions of the directory to 700. However, I'm unsure whether you will be able to include the files still. Try it and see
Encenta.com is offline  
Old 10-23-2005, 11:10 AM THREAD STARTER               #6 (permalink)
Senior Member
 
gamehouse's Avatar
Join Date: Sep 2005
Location: Montreal
Posts: 1,401
gamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to behold
 


Adoption
Okay, thanks I am going to try that.

I just read on sitepoints that 744 is if the directory contents are html or files that dont require excution. I will try all the options when there are not clients on my site. Otherwise, I may loose them and will post the result here. 700 sounds a bit extreme, then again I am not the master in this.
Thanks for hinting me about CHMOD, if it works, I will send you 25NP.

Thanks,

gamehouse
gamehouse is offline  
Old 10-23-2005, 11:26 AM   #7 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 579
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




don't for one second think that I'm the master. lol. If you're worried about it affecting clients. Run a test script. Create a new PHP file with the includes and save it in the same folder as the other PHP files. Good luck
Encenta.com is offline  
Old 10-23-2005, 03:28 PM THREAD STARTER               #8 (permalink)
Senior Member
 
gamehouse's Avatar
Join Date: Sep 2005
Location: Montreal
Posts: 1,401
gamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to beholdgamehouse is a splendid one to behold
 


Adoption
Okay I did it.

In facT before I saw your reply, I did as following.

I created a file and took all permissions off and put that in the directory where I want to deny direct access.

Voila, it worked, all other files untouched, the directory denies access since it has a file with no access given.

What do you think of that solution? Worth keeping it and enjoying the effect?

Thanks

Gamehouse
gamehouse is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using mod_rewrite and a .htaccess to do some redirection... 25 NP$ REWARD mholt Programming 0 09-21-2005 02:15 PM
.htaccess: Prevent users from seeing private directories! i386 CODE 1 07-27-2005 01:13 AM
.htaccess - help with relative path? TeviH Programming 4 07-24-2005 03:51 PM
.htaccess + Domain Parking wistow Programming 15 07-04-2005 08:46 AM
.htaccess D@Z Web Design Discussion 5 04-27-2005 08:27 PM

 
All times are GMT -7. The time now is 02:18 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger