Your website lives at two addresses simultaneously: www.example.com and example.com. To you, they are the same site. To Google, they are two completely different websites that happen to contain identical content — and Google penalizes duplicate content. This is the www redirect problem, and solving it is one of the first things every Joomla site administrator should do. This article compares the two most practical Joomla plugins for handling www redirects: Domain redirect and aiRedirectWww.
The Problem: Why www vs Non-www Matters
When a user types yoursite.com into their browser, the browser sends a request to http://yoursite.com. When they type www.yoursite.com, the browser sends a request to http://www.yoursite.com. From the perspective of the HTTP protocol, these are two different hosts, and there is no inherent connection between them. Without a redirect in place, both URLs serve your site's content, and both get indexed by search engines independently.
This is not a theoretical concern. Google's own Webmaster Guidelines explicitly recommend choosing one version — www or non-www — and redirecting the other to it. Failing to do so creates at least four distinct problems:
- Duplicate content penalty: Google sees your content at two URLs. Its algorithms may either filter one version out of search results — potentially the version that has more backlinks — or dilute the ranking power of your pages by splitting it between two URLs.
- Split backlink profile: When other sites link to you, some will use the www version and some will use the non-www version. All those links count toward your site's authority, but if the two versions are not consolidated, the authority is split. A redirect consolidates it all onto one canonical URL.
- Cookie and session confusion: Cookies set on yoursite.com are not automatically available on www.yoursite.com unless explicitly configured with the right domain scope. A user who logs in on one version may appear logged out on the other.
- Analytics fragmentation: Your traffic data gets split across two hostnames in Google Analytics, making it difficult to get an accurate picture of your total traffic without setting up filters and views to merge the data.
Plugin 1: Domain Redirect
Domain redirect is a Joomla system plugin that handles www-to-non-www and non-www-to-www redirection at the application level. It activates as a system plugin, meaning it hooks into Joomla's initialization process before any content is rendered. When a request arrives on the non-canonical hostname, the plugin immediately issues a 301 (permanent) redirect to the canonical version and terminates the request.
How It Works
After installation and activation through the Joomla plugin manager, Domain redirect presents you with a simple configuration panel. You specify your preferred domain format — with www or without — and the plugin handles the rest. It examines the HTTP_HOST header of every incoming request. If the host does not match your preference, a 301 redirect is issued to the correct hostname, preserving the full path and query string.
For example, if you configure the plugin to use the non-www format and a visitor requests www.yoursite.com/contact-us, the plugin redirects to yoursite.com/contact-us. The redirect preserves the path, the query parameters, and even the protocol — an HTTP request redirects to HTTP, and an HTTPS request redirects to HTTPS.
Configuration Options
- Redirect mode: Choose between www to non-www, non-www to www, or no redirect (plugin inactive)
- Redirect type: 301 (permanent) is the default and recommended setting for SEO purposes. The plugin also supports 302 (temporary) redirects for testing.
- Protocol handling: The plugin can optionally force HTTPS alongside the www redirect, which is useful if you are consolidating to a single canonical URL that also uses HTTPS.
Pros and Cons
Advantages of Domain redirect:
- Works at the Joomla application level, requiring no server configuration changes
- Simple configuration — one option to set, nothing else to configure
- Preserves query strings and paths correctly
- Compatible with Joomla's SEF URL system and third-party SEF extensions
- No need to edit the .htaccess file, which is especially valuable on shared hosting where .htaccess syntax errors can take the entire site offline
Disadvantages:
- Operates at the application layer — if Joomla fails to load (PHP error, database issue), the redirect does not happen
- Adds a small amount of processing overhead to every request, though this is negligible in practice
- No built-in testing or logging tools to verify that redirects are working correctly
Plugin 2: aiRedirectWww
aiRedirectWww is another Joomla system plugin with a similar purpose: it redirects visitors from the non-preferred version of your domain to the preferred version. Its approach is functionally similar to Domain redirect — it intercepts requests at the system plugin level and issues 301 redirects — but it has fewer configuration options and, based on community reports, some compatibility issues with certain Joomla templates.
How It Works
Like Domain redirect, aiRedirectWww examines the HTTP_HOST header of incoming requests. If the host does not match your configured preference, it constructs a redirect URL using the correct hostname and sends a 301 redirect. The plugin integrates into Joomla's plugin event system using the onAfterInitialise event, which fires early in the request lifecycle.
Configuration Options
- Redirect target: Choose whether to redirect to the www version or the non-www version
- Enable/Disable: A simple toggle to activate or deactivate the redirect
The configuration is minimal compared to Domain redirect. There is no option to choose between 301 and 302 redirects (it always uses 301), no protocol handling options, and no additional settings for edge cases.
Pros and Cons
Advantages of aiRedirectWww:
- Even simpler configuration than Domain redirect — essentially a single on/off toggle
- Zero-configuration approach works for most standard Joomla installations
- Smaller plugin file size and minimal codebase
Disadvantages:
- Reported incompatibility with certain Joomla templates, particularly those that perform their own URL rewriting or use non-standard routing
- Fewer configuration options — no HTTPS forcing, no redirect type selection
- Less actively maintained than Domain redirect, with fewer updates over time
- No error handling for edge cases like requests with unusual port numbers or proxy configurations
Head-to-Head Comparison
| Feature | Domain Redirect | aiRedirectWww | Manual .htaccess |
|---|---|---|---|
| Redirect type | Configurable (301 or 302) | Fixed (301 only) | Configurable |
| HTTPS forcing | Built-in option | Not available | Requires additional rules |
| Path preservation | Yes | Yes | Yes |
| Query string preservation | Yes | Yes | Yes |
| Template compatibility | Broad — works with all standard templates | Limited — issues reported with some templates | Universal — server-level |
| Requires .htaccess editing | No | No | Yes — requires manual editing |
| Risk of site outage | Low — plugin can be disabled | Low — plugin can be disabled | Medium — syntax errors can cause 500 errors |
| Works without Joomla | No — requires Joomla to be running | No — requires Joomla to be running | Yes — server-level, always active |
| Setup difficulty | Easy — install and configure | Easy — install and enable | Moderate — requires editing server files |
| Subdomain handling | Main domain only | Main domain only | Customizable via patterns |
| Price | Free | Free | Free |
The .htaccess Alternative: Manual Redirect Configuration
For administrators comfortable with server configuration, the most robust solution is not a plugin at all — it is a direct .htaccess rule placed before Joomla's own rewrite rules. A properly written .htaccess redirect operates at the Apache (or LiteSpeed) level, which means it executes before Joomla even loads, eliminating any dependency on the CMS being functional.
Here is the standard .htaccess code to redirect www to non-www:
And here is the reverse — redirecting non-www to www:
To include HTTPS in the redirect (recommended for sites with SSL certificates), modify the target URL to use HTTPS:
These rules should be placed at the very top of the .htaccess file, before Joomla's SEF rewrite rules. The order matters: the redirect must execute first, otherwise Joomla may process the request on the wrong hostname and generate internal links with the non-canonical URL.
Testing Your Redirects
After configuring any redirect solution — plugin or .htaccess — you must verify that it works correctly. Here is the testing procedure:
- Open a private browsing window (or use curl from the command line) to avoid cached redirects from previous tests
- Visit the non-canonical version of your domain — e.g., www.yoursite.com — and verify you are redirected to the canonical version
- Check that the path is preserved: www.yoursite.com/about-us should redirect to yoursite.com/about-us, not to the homepage
- Verify the HTTP status code using browser developer tools (Network tab) or curl -I. The redirect should return a 301, not a 302
- Test with query parameters: www.yoursite.com/?utm_source=test should preserve the UTM parameter in the redirect
- Set your preferred domain in Google Search Console and verify it matches your redirect direction
- Test internal links on your site — all links generated by Joomla should use the canonical hostname
Which Solution Should You Choose?
The decision tree is straightforward:
- If you have access to your .htaccess file and are comfortable editing it, use the .htaccess method. It is faster (no PHP execution required), more reliable (works even if Joomla is broken), and completely free of plugin overhead. This is the professional recommendation.
- If you do not have access to .htaccess — common on some managed hosting platforms — or you are not comfortable editing server configuration files, install Domain redirect. It is more feature-complete and better maintained than aiRedirectWww.
- Choose aiRedirectWww only if Domain redirect does not work with your specific template or hosting environment, which is rare. Its minimal configuration makes it a valid fallback, but it should not be your first choice.
Redirect Configurations: Use Cases
| Scenario | Recommended Solution | Reason |
|---|---|---|
| Standard shared hosting with cPanel | .htaccess | Server-level redirects are faster and bypass Joomla entirely |
| Managed WordPress/Joomla hosting (no .htaccess access) | Domain redirect plugin | Only option available without server access |
| Nginx server (no .htaccess support) | Domain redirect plugin | .htaccess is Apache-only; use plugin until you can add server config |
| Multisite or multi-domain setup | .htaccess with conditional rules | Plugins handle one domain only; server rules can handle multiple domains |
| Site with SSL certificate | .htaccess or Domain redirect with HTTPS option | Combine www redirect with HTTPS redirect in one step |
| Development or staging environment | Domain redirect with 302 temporary redirect | Do not use permanent redirects on staging — Google may index your staging URLs |
FAQ
Does www vs non-www affect SEO if both versions work?
Yes, significantly. Google treats www.yoursite.com and yoursite.com as separate websites. Without a redirect, your backlinks, authority, and rankings are split between two domains. A proper 301 redirect consolidates everything onto a single canonical domain.
Which is better for SEO: www or non-www?
Neither is inherently better. Google does not prefer one over the other. The key requirement is consistency: choose one version and redirect the other to it. Historically, some CDN configurations work better with www subdomains, but for most sites, the choice is purely a matter of preference.
Can I use both a plugin and .htaccess for www redirect?
Technically yes, but it is redundant and can cause redirect chains. Choose one method. If you use .htaccess at the server level, the plugin will never fire because the redirect happens before Joomla loads. If you use both, you risk creating a double redirect that slows down page loads.
What happens if I enable www redirect on a site with SSL?
You should configure the redirect to use HTTPS as the target protocol. If you redirect to HTTP, browsers and search engines will see an insecure redirect, which can trigger security warnings and hurt rankings. Domain redirect has a built-in HTTPS option; with .htaccess, add the https:// prefix to the target URL.
How do I test that my redirect is using 301 and not 302?
Open your browser's developer tools (F12), go to the Network tab, and visit the non-canonical version of your domain. The first request should show status 301 in the list. Alternatively, use the command line: curl -I http://www.yoursite.com should show HTTP/1.1 301 Moved Permanently.
Does the Domain redirect plugin work with Joomla 4 and 5?
Yes, Domain redirect is compatible with Joomla 3, 4, and 5. It uses standard Joomla plugin APIs that have remained stable across major versions. Always check the plugin's JED page for the latest compatibility information.
Will a www redirect break my existing backlinks?
No. A proper 301 redirect tells both browsers and search engines that the URL has permanently moved. Google transfers the ranking power of the old URL to the new one. Visitors who click old links with the non-canonical hostname are silently redirected to the correct URL.
Can I redirect only specific pages and not the whole domain?
Neither plugin supports page-specific redirects — they redirect the entire domain. For page-level redirects, use Joomla's built-in Redirect component (Components → Redirect) or add individual rules to your .htaccess file.
Do I need a plugin if I already set my preferred domain in Google Search Console?
Yes. Setting the preferred domain in Search Console tells Google which version to index, but it does not redirect users or other search engines. Visitors who type the non-canonical version will still land on the wrong URL. A server-level or application-level redirect is always necessary.
What should I do if the redirect creates a redirect loop?
A loop occurs when the redirect target is the same as the source — for example, redirecting www to www. Verify your configuration: if you want the non-www version, the target should be yoursite.com; if you want www, the target should be www.yoursite.com. Disable the plugin and test with .htaccess rules to isolate the issue.
Tap to react


