Web Hosting Talk







View Full Version : .htaccess <Files> directive problem!


UrlGuy
02-05-2006, 09:18 PM
Hi,

I'm helping this guy with setting up a free-host, and so far we've been able to force ads for users and remove the user of php/perl cgi scripts.

For the ads part I use 'AddHandler hadeared .html'.

But for his mainpage, which he has called 'index.html' (and already started advertising for), he dont want ads.

To remove ads from the main page I've tried a few things, such as:

<Files index.html>
RemoveHandler .html
</Files>

But this will remove the ads from ALL pages named 'index.html'. Also the users, which we don't want.

I have also tried some other things such as FilesMatch and Directory, although I kept failing, and sometimes getting internal server error.

The following is the htaccess we now have:


AddHandler headered .htm
AddHandler headered .html

Action headered http://www.mydomain.com/ads/config.php

AddType text/plain .php .php3 .php4 .phtml .pl .shtml .shtm .cgi


We would need something like...

AddHandler headered .htm
AddHandler headered .html

Action headered http://www.mydomain.com/ads/config.php

AddType text/plain .php .php3 .php4 .phtml .pl .shtml .shtm .cgi

<Directory /home/user/public_html/>
<Files index.html>
RemoveHandler .html
</Files>
</Directory>


But the above htaccess gives internal server error.

All we need to do is basicly, RemoveHandler from one specific file named 'index.html', so that ads arent shown on the mainpage.


Hope anyone can help with this. Greatly apprecciate all response on this!

Burhan
02-06-2006, 01:59 AM
hrmmn, can't you stick the RemoveHandler .html in the main httpd.conf (and not in .htaccess)?