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?

2 Answers 2

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
1
  • 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? Commented Aug 15, 2014 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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