You will get the Forbidden error message when you try to access a folder which is not a part of Drupal. I got that error message when I created a subdomain which was pointing to a folder inside a Drupal installation. At first, I wasn't thinking about Drupal and I was looking for a solution in a wrong direction until I realized the Drupal's strict .htaccess. Then, I came across a Drupal Answer - Make a folder inside the drupal installation public.
The solution is that you need to configure Drupal .htaccess to ignore the sub-folder for the sub-domain. Add a rewrite condition to ignore the sub-folder somewhere near the rewrite rule for index.php:
RewriteCond %{REQUEST_URI} !^/your-sub-folder/
...
RewriteRule ^ index.php [L]
And since the sub-folder is being influenced by the Drupal rewrite rules so the sub-folder needs to have its own rewrite rules. Add the following .htaccess file to the sub-folder:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /your-sub-folder/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
</IfModule>
Comments
Post a Comment