Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with .htaccess please ...

Status
Not open for further replies.

Floof

Technical User
Apr 25, 2001
23
0
0
FR
I use apache and php, in a directory in the /home/httpd/html tree, I have three types of files :
- Normal <*.php> files (accessible for everybody)
- Administration <*.admin.php> files (accessible only from one IP adress)
- php include <*.inc> files (unaccessible)

The content of the .htaccess file in this directory is :

Order Deny,Allow
Deny from All
Allow from All
Options Indexes

<Files /home/http2/html/agenda/*.inc>
Order Deny,Allow
Deny from All
</Files>

<Files /home/httpd2/html/agenda/*.admin.php>
Order Deny,Allow
Deny from All
Allow from xxx.xxx.xxx.xxx (my IP adress)
</Files>
 
What is is thast you wish to do with the .htaccess file?
 
I'd like to allow access for everybody on the &quot;*.php&quot; and &quot;*.html&quot; files.
To allow access to nobody on the &quot;*.inc&quot; files.
And access only from localhost to the &quot;*.admin.php&quot; files
 
First, I the webserver documentroot has to be at or below that directory tree in order for people to access it I believe ( I don't know whether symbolic links will be allowed). Second, if this condition is true, place a .htaccess file that will allow users or groups or both, with all required directives for access. Third, place proper permissions on the .php and html files for people to access them. Remember that the admin.php file has to either have password protetion or place it in another directory where it has to go through another (seperate) .htaccess file. Also ensure that permissions are only for the admin!

Hope this helps!

Rninja
 
I have to have all files in the same directory,
but I thought it was possible to put access
options in the .htaccess file for named files
with the <Files> directive.

So, only particular users would have access to
protected files.

The .htaccess I've tried to use is written in the
first message of this thread.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top