I am using apache's mod_rewrite. Drupal's htaccess already contains:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
I use Drupal's URL Path to generate a URL (www.example.com/members) for one Drupal's page/story
I also have a physical directory (/members), and it contains some files.
When visiting www.example.com/members/file.foo, it works properly: it either display the physical file (if it exists, or the Drupal's entry, if no this physical file)
However, when visiting www.example.com/members, I get error (403 forbidden): Directory index forbidden by Options directive: I am supposed to get a page that is generated by Drupal (www.example.com/members), this is no physical document root index file in this folder.
How can I fix this?
Thanks,
Comments
I think the right version of what I want is
1) If Drupal can handle a URL, let Drupal do it
2) If Drupal cannot handle a URL (not "registered" with Drupal), then try to see if such URL (file path) does exist in the server
The second rewrite condition
The second rewrite condition says to ignore the rewrite rule and go to the physical page (bypassing Drupal) if the *directory exists* - which it does. This happens before Drupal is even in the picture.
I highly recommend moving your page/story to another URL. It will save you a lot of grief. Otherwise, you *might* be able to get away with removing the -d line providing no other directories exist within your Drupal installation which have their own index.{php.html} file.
The advantage of moving your page/story is that you won't have this problem come up whenever you upgrade Drupal, and you can still have standalone directories/applications within your Drupal folder if you desire. Changing the .htaccess may make it work in a pinch, but you lose these advantages.
Thanks
Thank you. But I doubt if I can move page/story.
I am migrating static html files to Drupal and keep some archived static files untouched.
For example, there is an index.html in www.mysite.com/members. I created a page in Drupal and named it "members". In other words, when people visit www.mysite.com/members, they shall get a Drupal's node (thanks to url rewrite), instead of the physical index.html file.
There are some very outdated contents that are not required to be migrated to Drupal. Therefore, I keep some archive folders /members untouched, for example, /members/archive_A. When visiting www.mysite.com/members/archive_A, visitors get the physical index.html file.
Too bad, it seems no easy way to fix this, since .htaccess is loaded prior to Drupal, while I need some mechanism that first decide if a URL path exists in Drupal, if not, go to get the physical file.
What you can also do is a
What you can also do is a redirect. Move members/index.html out of the way to avoid conflicts. Now say you've got a file called members/index.php and it contains
I know I typed 'httq' which is so the link won't get expanded in this post and mess everything up. You would use http instead.
Assuming your web server is setup to use index.php files as well as index.html files, now when somebody goes to http://mysite.com/members they will get redirected back to the Drupal page 'members-new'.
bigheadfish - did you manage
bigheadfish - did you manage to fix this? I have the same issue...