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.

link|improve this question
Do you use cpanel to administrate this domain ? – Tuga 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
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.