Nginx - htaccess

Ultimate bridge for connecting Joomla! and phpBB 3.
Forum rules
This forum is not for any support questions/issues/features. Please use Support Center for such requests.
Post Reply
dynikz
Posts: 1
Joined: October 14th, 2017, 6:49 am

Nginx - htaccess

Post by dynikz »

Hello,

Does the bridge work in Nginx? With htaccess not being in Nginx, the rewrite rules can not be applied. Can these be converted somehow, or must I use Apache?

Thanks :)
User avatar
Admin
Site Admin
Site Admin
Posts: 1064
Joined: October 21st, 2008, 6:39 pm
Name: Administrator
Browser: Chrome

Re: Nginx - htaccess

Post by Admin »

Here is sample config part:

Code: Select all

location / {
  if ($request_filename ~ /phpBB3(.?)$){
    rewrite ^(.*)$ /forum redirect;
  }
  if ($request_filename ~ /phpBB3/index.php){
    rewrite ^(.*)$ /forum?$query_string redirect;
  }
  if ($request_filename ~ /phpBB3/ucp.php){
    rewrite ^(.*)$ /forum/user?$query_string redirect;
  }
  if ($request_filename ~ /phpBB3/viewforum.php){
    rewrite ^(.*)$ /forum/forum?$query_string redirect;
  }
  if ($request_filename ~ /phpBB3/viewtopic.php){
    rewrite ^(.*)$ /forum/topic?$query_string redirect;
  }
  if ($request_filename ~ /phpBB3/memberlist.php){
    rewrite ^(.*)$ /forum/members?$query_string redirect;
  }
  if ($request_filename ~ /phpBB3/report.php){
    rewrite ^(.*)$ /forum/report?$query_string redirect;
  }
  if ($request_filename ~ /phpBB3/posting.php){
    rewrite ^(.*)$ /forum/post?$query_string redirect;
  }
  if ($request_filename ~ /phpBB3/mcp.php){
    rewrite ^(.*)$ /forum/moderator?$query_string redirect;
  }
}
There is nice tool to convert htaccess rules into Nginx config:
https://winginx.com/en/htaccess
Post Reply