0

so we have a nginx and drupal site and the the folder structure looks like this

/my_site [ drupal site root]

/mysite/index.php [ drupal main index file]

/my_site/forum [ I created this folder this is not a standard drupal folder]

/my_site/forum/viewforum.php [I put this php file to do some custom logic ]

/my_site/forum/ [there is no index.php file as I want drupal to handle /forum and show the default forum module which it has]

everything works fine except when some goes to /forum they get forbidden 403 as there is no index file.

I have tried:

1) Making a symlink to point to the main index file

2) redirecting back to drupal root but then /forum just does not work

I am not sure how I can get nginx to allow drupal to handle /forum but not /forum/viewforum.php Please help

  • Can you post snippets of your nginx config? – masegaloeh Sep 10 '14 at 22:38
2

I assume you have already implemented Drupal routing features in your configuration.

To solve your issue, you should add this snippet in your configuration:

location = /forum {
    rewrite ^ /index.php last;
}

I assume my_site is your webroot, so that your index.php is in the root folder.

| 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.