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

1
  • Can you post snippets of your nginx config?
    – masegaloeh
    Sep 10, 2014 at 22:38

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .