?
Solved

.htaccess help needed

Posted on 2009-04-18
5
Medium Priority
?
456 Views
Last Modified: 2012-05-06
Hi folks,

I am trying to use an .htaccess file on my server but no matter how much documentation I have found, nothing states what the owner:group should be set to for the file as well as the permissions. I currently have the owner:group set to the same as the vhost. Do I need to set the owner:group to apache's owner:group instead?

As for the permissions, I have them set to 660. Should this be set to something else?

Finally, this is what I have for the .htaccess contents of the file. Is this workable code for blocking access to images and javascript files throughout the site?
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|js)$ [NC]
RewriteRule (.*)/leech.php [R,NC,L]

Open in new window

0
Comment
Question by:Richard Davis
  • 3
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
caterham_www earned 1500 total points
ID: 24178445
> Is this workable code for blocking access to images and javascript files throughout the site?

No, you'll need to check the referer for something external
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.com
RewriteCond %{HTTP_REFERER} !=""
RewriteRule \.(gif|jpe?g|png|js)$ /leech.php [R,NC,L]

Open in new window

0
 
LVL 12

Author Comment

by:Richard Davis
ID: 24178993
Thanks for the answer on the syntax part, but what about the permissions and ownership of the .htaccess file also?

~A~
0
 
LVL 12

Author Comment

by:Richard Davis
ID: 24180698
Would someone please tell me what the file permissions and ownership of an .htaccess file should be?
0
 
LVL 27

Assisted Solution

by:caterham_www
caterham_www earned 1500 total points
ID: 24180729
> what about the permissions and ownership of the .htaccess file also?

Nothing special, you can use the same you're using for your static html files.
0
 
LVL 12

Author Closing Comment

by:Richard Davis
ID: 31571870
thank you
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month17 days, 12 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question