bbPress Means WordPress. In This Article, bbPress Nginx Subdirectory Rewrite Rules is Assumed For a Fresh Subdirectory WordPress Installation. In other words – just what we wrote about WordPress Nginx Subdirectory Rewrite Rules, that got complex by adding bbPress Plugin. bbPress is quite good Forum Software taking that the usage is not huge. This setup is technically difficult and time taking for setting up for the first time, but it is many times easier to manage as the main WordPress installation at root is not touched.
bbPress Nginx Subdirectory Rewrite Rules : Think Just as WordPress Installation
If you think this new installation at subdirectory as a new WordPress installation first, it becomes easier. As the rules is going to be bigger, you can include as :
1 | include path/to/bbpress.conf; |
and add rules on that bbpress.conf
file. Rules specific for WordPress is written before plus WordPress officially has good documentation.
---
bbPress Nginx Subdirectory Rewrite Rules : Final Touch for bPress
After you make sure that this new WordPress installation is working exactly fine; install bbPress Plugin. Specially for bbPress, you in general need this config :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | rewrite ^/forum/page/([0-9]+)/?$ /forum/index.php?page=$1 last; rewrite ^/forum/forum/([^/]+)/page/([0-9]+)/?$ /forum/forum.php?id=$1&page=$2 last; rewrite ^/forum/forum/([^/]+)/?$ /forum/forum.php?id=$1 last; rewrite ^/forum/forum/?$ /forum/ permanent; rewrite ^/forum/topic/([^/]+)/page/([0-9]+)/?$ /forum/topic.php?id=$1&page=$2 last; rewrite ^/forum/topic/([^/]+)/?$ /forum/topic.php?id=$1 last; rewrite ^/forum/topic/?$ /forum/ permanent; rewrite ^/forum/tags/([^/]+)/page/([0-9]+)/?$ /forum/tags.php?tag=$1&page=$2 last; rewrite ^/forum/tags/([^/]+)/?$ /forum/tags.php?tag=$1 last; rewrite ^/forum/tags/?$ /forum/tags.php last; rewrite ^/forum/profile/([^/]+)/page/([0-9]+)/?$ /forum/profile.php?id=$1&page=$2 last; rewrite ^/forum/profile/([^/]+)/([^/]+)/?$ /forum/profile.php?id=$1&tab=$2 last; rewrite ^/forum/profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /forum/profile.php?id=$1&tab=$2&page=$3 last; rewrite ^/forum/profile/([^/]+)/?$ /forum/profile.php?id=$1 last; rewrite ^/forum/profile/?$ /forum/profile.php last; rewrite ^/forum/view/([^/]+)/page/([0-9]+)/?$ /forum/view.php?view=$1&page=$2 last; rewrite ^/forum/view/([^/]+)/?$ /forum/view.php?view=$1 last; rewrite ^/forum/rss/?$ /forum/rss.php last; rewrite ^/forum/rss/topics/?$ /forum/rss.php?topics=1 last; rewrite ^/forum/rss/forum/([^/]+)/?$ /forum/rss.php?forum=$1 last; rewrite ^/forum/rss/forum/([^/]+)/topics/?$ /forum/rss.php?forum=$1&topics=1 last; rewrite ^/forum/rss/topic/([^/]+)/?$ /forum/rss.php?topic=$1 last; rewrite ^/forum/rss/tags/([^/]+)/?$ /forum/rss.php?tag=$1 last; rewrite ^/forum/rss/tags/([^/]+)/topics/?$ /forum/rss.php?tag=$1&topics=1 last; rewrite ^/forum/rss/profile/([^/]+)/?$ /forum/rss.php?profile=$1 last; rewrite ^/forum/rss/view/([^/]+)/?$ /forum/rss.php?view=$1 last; |
We are assuming that your subdirectory’s name is forum
. You should add this within the server { }
block (via include file as pointed before). bbPress and WordPress both has community support, you can ask there if you still face issue. Just for reminder, we are calling this new WordPress installation’s index.php in this way :
1 2 3 | location /forum { try_files $uri $uri/ /forum/index.php?q=$request_uri; } |
The advantage with forum
name is – you can understand any error easily from the log files.