Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 12-02-2011, 05:28 AM   #1
Senior Member
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Rep: Reputation: 30
use htaccess higher up directory no symlinks?

I have 3 folders for 3 different websites all with an admin folder that I currently block off IP addresses with via an htaccess file:

order deny,allow
deny from all
allow from


Each site runs different code and different databases so I cannot combine them.

How can I combine each of these htaccess files into 1 htacess file at the higher level domain linuxfolder so I don;t have to keep adding IP addresses into 3 individual files?

I do not have root access to the server so cannot use symlinks.
Old 12-02-2011, 04:46 PM   #2
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,178

Rep: Reputation: 1392Reputation: 1392Reputation: 1392Reputation: 1392Reputation: 1392Reputation: 1392Reputation: 1392Reputation: 1392Reputation: 1392Reputation: 1392

I guess /path/to/linuxfolder is your docroot. If that's the case, you can use mod_rewrite in a .htaccess file in docroot, like this:
RewriteEngine on

RewriteCond %{REQUEST_URI} ^/admin
RewriteCond %{REMOTE_HOST} !^109.150.55
RewriteRule (.*) - [F]
If you want to allow saccess to pecific hosts and not to the whole subnet, you can replace the 2nd RewriteCond with this
RewriteCond %{REMOTE_HOST} !^
RewriteCond %{REMOTE_HOST} !^
and so on

Old 08-20-2012, 09:10 AM   #3
LQ Newbie
Registered: Aug 2012
Posts: 15

Rep: Reputation: Disabled
Exclamation Be careful with that Limit Tag

qwertyjjj - I realize this response is a couple months late, but please note that there is some potential for this style of htaccess configuration to be bypassed. As outlined in the linked blog post, Apache may still hand off a request from those IPs if they use an HTTP method other than what you have specified in the Limit tag.

Read about it here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using .htaccess instead of symlinks PlymWS Linux - Server 1 04-06-2010 12:43 PM
I am having a problem with my symlinks in the /dev directory JasonC10203 Linux - Newbie 2 08-13-2008 08:49 AM
script/command to delete all symlinks from a directory reddazz Linux - General 5 03-15-2005 11:39 PM
Directory with .htaccess is invisible?! Barca Linux - General 5 02-23-2005 12:28 PM
symlinks in / directory Bruce Hill Linux - Software 4 10-24-2004 08:32 PM

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration