I put this in httpd.conf
Reloaded apache.
<FilesMatch "\.(gif|jpe?g|png)$">
Order allow,deny
Deny from all
</FilesMatch>
I'm expecting no files to be accessible from browser except image files, but I can access no probs test.php
what am I doing wrong?
I can't figure out how to write an .htaccess file which blocks all access to a directory except for reading html files, which sould be allowed and php-files which require athentication. Denying all access and allowing html works fine but asking for a password for php-files doesn't.
I know there are a number of different ways to redirect using apache although I wanted to check if this is the correct way of doing it via virtual host?
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example/public
<Directory "/var/www/example/public">
Options +FollowSymlinks
# Prevent Direct Access to files
<FilesMatch "\.
In my httpd.conf I have:
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>
And in my .htaccess file I have:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.
I have a few private files in a public folder and I want to block access to them.
For example lets say I have the following files tree:
DictA
FileA
FileA
FileB
FileC
I want to block access to FileB and FileA in the current directory and allow access to the FileA in the DictA directory.
I am using Apache 2.2.22. The following code is not working. What should i do make it work. I am on ubuntu 12.04. What are the AddOutputFilterByType's requirements
#.htaccess
<FilesMatch "\.combined\.js$">
Options +Includes
AddOutputFilterByType INCLUDES application/javascript application/json
SetOutputFilter INCLUDES
</FilesMatch>
Making multiple requests to the server causes a 404 error after about 40-60 seconds.
I am using JavaScript to request: example.com/test/location. Apache has mod_rewrite enabled that maps this to the file index.php.
Been surfing around for a solution for a couple days now.
How do I enable Apache hotlink protection without hardcoding my domain in the config file so I can port the code to my other domains without having to update the config file every time?
This is what I have so far:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www\.example\.com [NC]
RewriteRule \.(gif|ico|jpe|jpeg|j
I have searched the forum high and low for the solution with no success, so I will now post this problem, with all known facts. Linux (and Fedora) is brand new to me so I'm somewhat illiterate with the language and recommendations from reading other threads. Please bare with me.