The Redirect Pro module for WHMCS enables you to create and manage advanced URL redirects with ease. This guide will walk you through the process of setting up redirects using the module's form, explaining the available options and best practices for effective redirect management.
Getting Started
NHG Redirect Pro supports two main types of URL redirects:
-
Exact Match: Redirects only when the source URL matches exactly (e.g., /old-page → /new-page).
-
Phrase Match: Redirects when the source URL contains a specified phrase (e.g., /old-path/subpage → /new-path/subpage if Preserve URI is enabled, or /new-path if disabled).
Key Features
-
Flexible Matching: Choose between Exact or Phrase Match for redirect rules.
-
Preserve URI: Optionally append the remaining part of the URL for Phrase Match redirects.
-
HTTP Redirect Codes: Select from 301 (Permanent), 302 (Temporary), 307 (Temporary), or 308 (Permanent) redirect codes.
-
Logging: Monitor redirect activity to troubleshoot and verify functionality.
-
Enable/Disable Rules: Temporarily disable redirects without deleting them.
How to Add a Redirect Rule
Follow these steps to create a new redirect rule using the Redirect Pro module:
-
Access the Redirect Pro Module:
-
Log in to your WHMCS admin panel.
-
Navigate to Addons > Redirect Pro.
-
-
Open the Add Redirect Form:
-
Click the Add Redirection button to access the form.
-
-
Fill Out the Form: The form includes the following fields:
-
Type:
-
Select Exact for an exact URL match or Phrase for a partial URL match.
-
Example: For /old-page to /new-page, choose Exact. For /old-path to redirect to /new-path (with or without subpages), choose Phrase.
-
-
Source URL:
-
Enter the URL you want to redirect from (e.g., /old-page or /old-path).
-
Note: Do not include a trailing slash (/) at the end of the URL.
-
-
Target URL:
-
Enter the destination URL (e.g., /new-page or /new-path).
-
Ensure the target URL is valid and accessible.
-
-
Preserve URI:
-
For Phrase Match redirects, choose Yes to append the remaining URL path to the target (e.g., /old-path/subpage → /new-path/subpage) or No to redirect to the target URL only (e.g., /old-path/subpage → /new-path).
-
This option is ignored for Exact Match redirects.
-
-
Redirect Code:
-
Choose the appropriate HTTP redirect code:
-
301 (Move Permanently): For permanent redirects, informing search engines to update their indexes.
-
302 (Move Temporarily): For temporary redirects, without affecting SEO.
-
307 (Redirect Temporarily): Similar to 302 but enforces the same HTTP method.
-
308 (Redirect Permanently): Similar to 301 but enforces the same HTTP method.
-
-
Use 301 or 308 for SEO-friendly permanent redirects, and 302 or 307 for temporary ones.
-
-
Disable:
-
Check the Tick to disable box if you want to create the rule but keep it inactive.
-
This is useful for testing or staging redirects without applying them immediately.
-
-
-
Save the Redirect:
-
Click the Save button (with the save icon) to create the redirect rule.
-
To cancel and return to the main Redirect Pro page, click the Back button (with the reply icon).
-
Best Practices
To ensure smooth operation and avoid issues, follow these recommendations:
-
Test Redirects: Always test your redirects in a staging environment or with temporary codes (302/307) before applying permanent ones (301/308).
-
Avoid Trailing Slashes: Do not include a trailing slash (/) in the Source or Target URLs to prevent unexpected behavior.
-
Order Redirects: Arrange redirects from most specific to least specific to avoid conflicts (e.g., place /old-path/subpage before /old-path).
-
Monitor Activity: Enable the logging feature to track redirect performance and identify issues.
-
Temporary Coexistence: When changing URL structures, keep both old and new URLs active temporarily to avoid broken links.
-
Validate Patterns: If using regex patterns (not covered in this form but mentioned in the module's features), test them with online regex testers to ensure accuracy.
Examples
Exact Match Example
-
Type: Exact
-
Source URL: /old-page
-
Target URL: /new-page
-
Preserve URI: Ignored
-
Redirect Code: 301
-
Result: Visiting /old-page redirects to /new-page.
Phrase Match Example (With Preserve URI)
-
Type: Phrase
-
Source URL: /old-path
-
Target URL: /new-path
-
Preserve URI: Yes
-
Redirect Code: 301
-
Result: Visiting /old-path/subpage redirects to /new-path/subpage.
Phrase Match Example (Without Preserve URI)
-
Type: Phrase
-
Source URL: /old-path
-
Target URL: /new-path
-
Preserve URI: No
-
Redirect Code: 302
-
Result: Visiting /old-path/subpage redirects to /new-path.
Troubleshooting
-
Redirect Not Working: Verify that the Source URL matches the intended pattern and there are no trailing slashes. Check if the rule is disabled.
-
Unexpected Redirects: Ensure redirects are ordered correctly (specific to general). Use the logging feature to diagnose issues.
-
SEO Concerns: Use 301 or 308 for permanent redirects to maintain search engine rankings.