You are not logged in.
- From: Norway
- Registered: Jul 2006
- Posts: 308
.htaccess to stop external use
Is it possible to use .htaccess files to stop other sites from including files (through php includes, iframes and the like), link to the site and can .htaccess files be appended through php?
Looking into blocking external sites from in any way exploit content on a site I'm building, as well as link directly to certain files. And develop a block/ban-system through banning IPs' in .htaccess (without having to actually open the file myself through FTP).
Re: .htaccess to stop external use
yes you can. I'm not an expert in apache's config stuff but I know for sure it's possible. you may want to look for an apache users group and ask on the particulars of that. I usually just mess around with it until I get something to work (with one page opened to my site, and another opened to apache's conf user documentation).
I wrote a spam script that worked across several of my sites, and when a hack attempt happened on one, it added denial entries on the other site's .htaccess files.
I ended up taking it off though once the file grew to several gig, and folks complained about not being able to access my site (cause apparently I'd blocked most of Asia).