When managing multiple store locations or sub-brands, inconsistent URL structures like mixing www.example.com and example.com can split traffic and confuse search engines. This article outlines how regional retail teams can use permanent HTTP 301 redirects to consolidate these addresses into a single canonical version, ensuring consistent branding and improved SEO performance without requiring complex infrastructure changes.

Scenario: A Regional Retail Team Faces Duplicate Domain Access

In this hypothetical scenario, a regional retail team has just consolidated three storefronts under one domain and discovered that both the www hostname and the bare apex hostname answer on the same server. The shared hosting account returns the same storefront either way, so the team treats this as a link-consistency problem to settle before printing new signage.

The team's working inventory is small and entirely its own: a launch notes document listing the two hostname forms, a spreadsheet of printed materials that will carry the address on the storefront and on bag inserts, and a sitemap export showing which internal links already use which form. The author's naming note reads "prefer the www form everywhere" and marks the bare apex form as the alias to retire.

From that material, the team drafts three candidate page titles for the customer-facing help page that will explain the change: "One Address for Every Store," "Finding Us Online After the Address Update," and "Why the Address Bar Looks Simpler Now." The author keeps the first and third, dropping the second because it describes a timing claim the team cannot back with the notes on hand. This is a judgement about wording only, not evidence that any redirect is live.

Pulling two fictional rows from the printed-materials spreadsheet shows how the team classifies them. Row one: "Bag insert, summer run — address printed in full www form — keep as planned." Row two: "Window decal, east location — address printed in bare apex form — return to the print vendor for a corrected proof before reordering." The first row needs no action; the second is flagged because the decal stock would otherwise reproduce the retired form.

For the redirect itself, the team's plan is the ordinary picture: one rule that answers requests for the bare apex hostname with a permanent redirect pointing at the same path on the www hostname, preserving the path and query so bookmarks to product or store pages still land in the right place. The author notes that the path must be carried over rather than sending every apex request to the home page, since the sitemap export shows deep store pages in use.

The three print and help-page items above are examples written for this scenario to show how a team would sort its own materials. They are not a record of a past site, a measurement of search behavior, or a claim about what any hosting panel will do by default.

Selecting the Canonical Hostname for Unified Brand Identity

Google's Search Central documentation states that when a page can be reached through multiple URLs, such as an apex form, a www form, and a subdomain form, you should pick one URL as the canonical URL and use redirects to send traffic from the other URLs to the preferred URL. For the quickest effect, it recommends HTTP (server-side) redirects. The same page notes that redirects are a strong signal that the redirect target should become canonical, and that all permanent redirection methods have the same effect on Search.1

You can begin by deciding which of the two answering hostnames should be the one you treat as canonical, because that single choice will shape every card, sign, and help-page line that follows. One practical way to settle it is to make a small comparison table of the two forms against the questions you can answer yourself: does the www form match what appears on taller signage, does the bare apex read cleanly aloud on radio or in a delivery note, and which form is already typed on more of your existing printed pieces. These are your judgments about your own materials, not external requirements.

A hypothetical team might fill such a table with three rows and then mark one form as preferred, writing a short reason beside it. For instance, they could note that the apex form is shorter on narrow bag inserts while the www form matches an existing loyalty-card line. Either outcome can work; you might choose the form that appears in the most places you cannot easily reprint. Let the reason sit next to the choice so the later print review has something concrete to check against, and consider revisiting the table if new signage enters the plan.

Implementing Permanent Redirects via Server-Side Configuration

For permanent redirects, the documentation recommends server-side implementation whenever possible, describing it as the best way to ensure that Google Search and people are directed to the correct page. Setting up server-side redirects requires access to the server configuration files, such as the .htaccess file on Apache, or setting the redirect headers with server-side scripts such as PHP.2

With PHP, the documented approach is to use the header() function and set the headers before sending anything to the screen, issuing the 301 Moved Permanently status with a Location header pointing to the target URL, then calling exit. Where configuration file access exists, the same source points to Apache documentation for writing the rules yourself, including mod_alias for the simplest redirect forms and mod_rewrite for more complex ones, and to NGINX guidance for creating rewrite rules.2

You can take the server configuration file you already have for the consolidated storefront and decide which hostname block should hold the permanent redirect rule. Read the file top to bottom once and mark which block currently answers for the bare apex hostname, since that is the block you would edit rather than the one serving the preferred www form.

Suppose your file has two blocks. In the first, you might keep the www hostname as the canonical responder and add a permanent redirect inside the apex block that points every request to the www form, preserving the requested path. In the second, you might reverse the direction if your signage and help page already use the bare apex form. Either choice can work; the point is to pick one direction and apply it in a single place rather than adding scattered rules.

As a writer's example, you might draft the comment above that rule as "apex to www, keep path" and then check it against the two fictional rows from your printed-materials sheet. A bag insert showing the full www address would stay as printed, while a sign showing only the apex form might be flagged for the next print run. This is a hypothetical check, not a record of a completed edit.

Using .htaccess Files for Directory-Level Redirection Control

For directory-level control, the Apache HTTP Server 2.0 documentation describes .htaccess files as distributed configuration files placed in a particular document directory; the directives inside apply to that directory and all subdirectories. Such a file can contain one or more configuration directives, and a setting placed in a directory applies downward from there.3

The same documentation notes that whether a directive is honored depends on AllowOverride, which specifies in categories which directives will be recognized in a .htaccess file. For a given directive, the documentation's Override section states the required AllowOverride value.3

Directives are applied in the order they are found, so a .htaccess file in a directory may override directives found in files higher up the tree. Settings permitted in .htaccess can similarly be made in a Directory section of the main server configuration.3

With the canonical hostname chosen, you can turn to the server configuration file you already keep for the consolidated storefront and decide which directory should carry the permanent redirect rather than relying on one blanket rule. For a retail setup, you might place a small set of rules at the storefront folder level so that requests arriving under the non-canonical hostname are answered with a permanent redirect that keeps the requested path intact. Consider writing a brief comment above each rule naming its scope, for example "storefront folder, apex to www, keep path," so a colleague editing later can tell which directory it governs without rereading the whole file.

You might then compare that directory choice against your own working notes. If a printed bag insert points to a seasonal offer page rather than the homepage, you can check whether the folder-level rule still carries the full path through, and note the answer beside the row in your spreadsheet. This is an author's example, not a record of a past change: it shows how one ordinary path can be traced from file to print.

The choice remains yours. You can keep the redirect narrow to the storefront directory, or widen it only after confirming that other folders are meant to behave the same way.

Verifying Redirect Status Codes and Target Consistency

The source describes an IIS URL Rewrite walkthrough in which a common scenario is enforcing a canonical hostname by redirecting requests to www rather than the non-www host. In the walkthrough, the author tests the imported rules by opening a browser and visiting localhost and the non-www hostname; in both cases the browser redirects to the www hostname, and the same holds when port 8088 is added to the request.4

The source also states that the rewrite module attempts to convert Apache mod_rewrite rules into functionally equivalent IIS URL Rewrite rules, but not all mod_rewrite rules can be converted because of architectural differences between Apache and IIS. It recommends studying the mod_rewrite rule set before converting and then reviewing and testing the converted result to confirm it provides the same rewrite logic. Only rules following Apache mod_rewrite syntax can be converted.4

Once the redirect is decided, you can open the server configuration file and look at the response each hostname block returns. For the block you are not treating as canonical, check that the status is a permanent 301 rather than a temporary 302; for the canonical block, check that it answers directly with 200 and is not pointing back at the other form. You might note both values beside the two hostname lines in your working inventory so the pair is easy to compare later.

Then follow one target path through the redirect and compare where it lands. If a printed bag insert points to a seasonal offer page, you can type that path after the non-canonical hostname and see whether the destination keeps the same path or collapses to the homepage. A result that drops the path would tell you the rule needs narrowing before signage is reprinted.

The check is yours to set. You can record a short line such as "apex to www, status 301, path kept" in your notes, or keep the comparison to yourself and simply confirm the two entries agree before the file is finalized.

Managing Temporary vs. Permanent Redirect Scenarios

With Apache HTTP Server's mod_alias, the Redirect directive defaults to a temporary redirect (HTTP status 302) when no status argument is given. To signal a permanent move instead, the documentation shows the permanent argument returning status 301, and states that RedirectPermanent is exactly equivalent to Redirect permanent. RedirectTemp likewise equals Redirect temp.5

For either kind, only complete path segments are matched. Additional path information beyond the matched URL-path is appended to the target URL, and GET parameters are carried over, but POSTs are discarded. A relative target like a URL-path beginning with a slash gets the current server's scheme and hostname added; otherwise the target may be an absolute URL.5

You can review your own launch notes for any place where a temporary redirect was used during the consolidation, such as pointing an old storefront path at a staging page while content moved. Mark those entries as temporary and keep them in a separate column from the permanent apex-to-www rule, because the two need different handling when the staging page is retired.

For each temporary entry, note the removal date you already planned and whether the old path will then receive a permanent redirect or be retired entirely. A hypothetical row might read "old seasonal page, temporary, retire after spring run, then permanent to new offers page," while a permanent row stays simply "apex to www, permanent." You might keep both kinds in one table with a status column rather than merging them, so the temporary ones stay visible until they are cleared.

Frequently asked questions

How can I settle which of my two hostnames to treat as canonical by comparing them myself?

You can begin by deciding which of the two answering hostnames should be the one you treat as canonical, because that single choice will shape every card, sign, and help-page line that follows. One practical way to settle it is to make a small comparison table of the two forms against the questions you can answer yourself: does the www form match what appears on taller signage, does the bare apex read cleanly aloud on radio or in a delivery note, and which form is already typed on more of your existing printed pieces.

How does the team classify row one from the printed-materials spreadsheet?

Pulling two fictional rows from the printed-materials spreadsheet shows how the team classifies them. Row one: "Bag insert, summer run — address printed in full www form — keep as planned."

How might I draft and check the comment above that redirect rule against my printed-materials rows?

As a writer's example, you might draft the comment above that rule as "apex to www, keep path" and then check it against the two fictional rows from your printed-materials sheet. A bag insert showing the full www address would stay as printed, while a sign showing only the apex form might be flagged for the next print run.