Ubuntu Server 12.04 を実行している Web サーバーに Joomla をインストールしました。Joomla フォルダーは /var/www/cms/ にあります。
/etc/apache2/sites-enabled/default にある vhost ファイルには、次の内容が含まれています。
<VirtualHost *:80>
ServerName domain.com/
Redirect permanent / https://domain.com/
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName domain.com:443
DocumentRoot /var/www/cms
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/cms>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
(...)
</VirtualHost>
現在、domain.com へのすべてのリクエストとその後に入力された domain.com/example などのすべてのリクエストは、適切なページにリダイレクトするか、カスタム 404 エラーを返す Joomla によって指示および処理されます。これはすべて機能します。
ここで、domain.com/subfolder に送られるすべてのリクエストをフィルタリングしてから Joomla で処理し、/var/www/subfolder (/var/www/cms/ のルート フォルダーではなく) にリダイレクトしたいと考えています。
/etc/apache2/sites-enabled/default 内のファイル (上記参照) は、このようなリダイレクトを定義する適切な場所だと思いますが、どの位置でどのようにこれを達成するかを理解できませんでした。