My sites are hosted on a server where I have ftp access to a single folder, and my two registered domains are in two sub folders, to which the DNS servers point visitors for each domain.
host root--|
----domain1 - php script
----domain2 - php script
At the moment I have a php script in each domain root, which writes a "deny from" statement after certain types of bot visit, to the .htaccess file in the root folder but I want it to write to the .htaccess in the sub folder for thath domain. When it is written to the .htaccess in the ftp root, it doesn't seem to deny access to the subfolders.
The line in the two domain php files, which is duplicated in the root of each domain subfolder, is
$file = '../.htaccess'; //edit for path to your htaccess file
This points back to the "top" .htaccess file, but any "deny from" statements added there don't seem to affect access to the sub domains.
Either - I need to get the correct syntax in my .htaccess file so that the "deny from IP address" lines in the top level .htaccess apply to the two domains hosted below it
Could someone advise please?
two dots obviously means the ftp root directory.
How do I go to the domain root and not the ftp host root?
What is the address of my domain root? Obviously not '../.htaccess'
Alternatively - what should I investigate to make the "deny from IP " list in the ftp root apply to both the domains below it?
Many thanks once again. I've only just moved to having two domains with my hosting package so am learning it all over again!