NGINX Configuration Rewrite Rule for Ultimate Member Social Activity

Overview

When hosting your website with NGINX, it's essential to manually add rewrite rules to the NGINX configuration to ensure the proper functionality of Ultimate Member. This ensures that features like the Social Activity extension and custom rewrite rules for Group activity images work correctly.

Adding Rewrite Rules

To configure NGINX rewrite rules for Ultimate Member, add the following rewrite rule to your NGINX configuration:

rewrite ^/um-activity-download/([^/]+)/([^/]+)/([^/]+)/\d{1,10}\.(gif|png|jpeg|jpg)$ /index.php?um_action=um-activity-download&um_post=$1&um_author=$2&um_verify=$3 last;

Purpose of the Rewrite Rule

This rewrite rule ensures that requests to the specified URL pattern are correctly redirected to the Ultimate Member endpoint. This enables features like the Social Activity extension to function smoothly. Custom rewrite rules may also be necessary based on your site's specific needs.

Example

  • Original URL: http://example.com/um-activity-download/post_id/author_id/verify_key/image.jpg
  • Rewritten URL: http://example.com/index.php?um_action=um-activity-download&um_post=post_id&um_author=author_id&um_verify=verify_key

Notes

  • Ensure that the path to the index.php file matches the actual path on your server.
  • Additional custom rewrite rules may be required depending on your site's setup and requirements.

By configuring NGINX rewrite rules for Ultimate Member, you can ensure that your website functions smoothly and provides users with a seamless experience.


Related articles: