.htaccess help needed

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
calimero_php
Forum Newbie
Posts: 4
Joined: Wed Oct 13, 2010 9:42 am

.htaccess help needed

Post by calimero_php »

Hey,

Appology if i missposted - didnt find this topic explicitly directed to other forums.

After several hours of banging my head against .htacess type file i am no closer to getting the desired result from my apache server:

1. Only allow people/users to (i think keyword is) read file - aka to prevent them to download it or to do any of those nasty things to it (php should do its stuff but php file not to be alowed to be downloaded or exploited in related maner). Entire website is based on 1 php file, 1 js file and some pictures - all in http://localhost/ or http:/localhost/e/

2. To redirect based on this pattern (from these 2 directories):
http://localhost/random_string1/
http://localhost/e/random_string2/
to
http://localhost/1_8.php?q=random_string1
http://localhost/1_8.php?q=random_string2
(I know how to do this in PHP but i would like to find a way to do it in apache to use it amongst other things as 404 option)

My server is: Apache 2.x, PHP 5x, Zend server bundled ( default configuration), it allows me to input these paramters in its *.ini file without the need to create specific .htacess files - only need code inputed there.

Help much appreciated
Tnx.
Post Reply