Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I got a domain with a website that can be reached by two urls, mydomain.com/pathA and mydomain.com/pathB.

But they are actually the same directory on the server. It contains a MediaWiki installation, which is quite large and contains image files that should be shared. But since I don't want to present it as a wiki per se, I want to be able to setup different hooks, add-ins, rights, skins, etc. So now I created a symbolic link from pathA to pathB and added this .htaccess in the doc root:

Options -Indexes

RewriteEngine On

RewriteCond %{REQUEST_URI} ^/pathA
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /pathA/index.php?title=$1 [L,QSA]

RewriteCond %{REQUEST_URI} ^/pathB
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /pathB/index.php?title=$1 [L,QSA]

Now I want pathB to be protected using Apache authentication. Can I do that in this one .htaccess file? I cannot edit httpd.conf.

If this can be done without the symlink it is fine with me, as long as I can keep the single installation folder.

share|improve this question
Do you use cpanel to administrate this domain ? –  Pedro Lobito Aug 20 '11 at 22:31
No, I got SSH access and SCP for uploading files. I think I can do quite a lot on this server, but I don't want to mess with apache configuration, because other websites run on it too. –  GolezTrol Aug 21 '11 at 8:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.