Link to home
Start Free TrialLog in
Avatar of mstrelan
mstrelanFlag for Australia

asked on

mod_rewrite two subdirectories to root index.php, everything else to index.html

Hi experts,

I have a drupal multisite set up with two subdirs (as symbolic links) and drupal running in the root dir. I need to modify the .htaccess file so that requests to the subdirs go to the index.php file (standard drupal behaviour) but any request outside of those subdirs go to index.html

Any suggestions? attached is the relevant section from the drupal default .htaccess file
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

Open in new window

Avatar of proadmin
proadmin
Flag of United States of America image

Seems like you need a {HTTP_HOST} condition if you want to catch subdomains.

I suggest you do it this way.

^subdomain\.maindomain\.com$
Avatar of mstrelan

ASKER

Sorry I was specifically after a subdirectory, not a subdomain.
Avatar of Michael Worsham
As an example, if you have say a 'testing' subdirectory, which index.php file do you want it to access?

/testing/index.php

_or_

/index.php

/index.php
SOLUTION
Avatar of Michael Worsham
Michael Worsham
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial