0

I have a directory that I want to load through the Drupal system, which of course is fine with clean URLS:

/my-dynamic-page/

However at this directory I then want to serve static pages

/my-dynamic-page/static1

When I add a folder for /my-dynamic-page/ to the server, this now bypasses the Drupal system. While the static pages now work, when you try and load /my-dynamic-page you get a Forbidden error. This is because the Drupal system has been bypassed (there is a physical folder now) so the system looks for an index file.

How do I overcome this?

1

Add your own .htaccess file under the my-dynamic-page and my-dynamic-page/static1 with only this in it:

DirectoryIndex index.html index.htm
| improve this answer | |
  • Hey J, this doesn't seem to be working for me. The problem is the folder /my-dynamic-page/ doesn't have an index file, because the folder just serves for the inner static files. When the /my-dynamic-page is loaded I somehow need to tell it to use the root index.php I think? – Scott Lawrence Aug 15 '14 at 22:33
0

Thanks to J.Reynolds whose answer pointed me in the right direction to use DirectoryIndex.

In the dynamic directory I created a .htaccess with the following:

DirectoryIndex index.php /index.php

So it looks for a local index.php first, if not then goes to the root PHP index file.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.