Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-01-13 08:36:35

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

common elements for htaccess between sites

Is there a way to have some elements of the htaccess in a .txt file (or other) and call it in the htaccess files in different sites within my TXD account?

Our sites are getting attacked by spam referrers and instead of repeating the task of adding Deny from on each htaccess file I am trying to find a way to ‘centralise’ this ban list.

Checking google revealed no suggestions but I might be using the wrong keywords.

Any help would be appreciated.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2013-01-13 10:04:02

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

Re: common elements for htaccess between sites

You might want to try adding common elements to your main Apache configuration file instead of spreading them across directory-specific .htaccess files.

If you run Webmin on a Joyent SmartMachine, go to Webmin > Servers > Apache > Global configuration > Edit config files and choose “/opt/local/etc/httpd/includes/directory.conf”.

Add an entry there which would look a bit like so:

<Directory /home/myusernamehere/web/public>
Order allow,deny
Deny from 1.2.3.4
</Directory>

You better know what you do. There be dragons!

Do not forget to restart Apache after you made these changes as otherwise they won’t be applied to the current web server process.

Offline

#3 2013-01-13 10:29:45

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: common elements for htaccess between sites

Hi Robert,

Thanks for the reply. Unfortunately txd does not give me an option for Servers in Virtualmin. Since I posted here I found this post which I am experimenting with. I will post the results here.

>Edited to add. It is another dead end for me as I have no access to server/vhost config

Last edited by colak (2013-01-13 10:41:21)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2013-01-14 17:39:27

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: common elements for htaccess between sites

so… there is no other way I guess…


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB