Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Set https://www.example.com as the canonical hostname and permanently redirect every request for example.com to the matching HTTPS WWW URL. A server-side 301 or 308 redirect is the correct solution: it sends visitors and crawlers to one address while preserving the requested path and, when configured correctly, the query string.

What the redirect should accomplish

A hostname redirect is more than a cosmetic change. The apex hostname (example.com) and the WWW hostname (www.example.com) are different URLs, even when they serve identical files. Leaving both accessible can split links, cookies, analytics, cache entries and search signals between two versions of the same site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The target should be the HTTPS WWW equivalent of the requested URL:

  • http://example.com/ becomes https://www.example.com/.
  • https://example.com/about becomes https://www.example.com/about.
  • http://example.com/products?a=1 becomes https://www.example.com/products?a=1.

Google Search Central recommends choosing one preferred (canonical) destination when a page is reachable through multiple hostnames and using redirects from the alternatives. It describes a permanent server-side redirect as the strongest option for a permanent URL move. The redirect does not replace other canonicalization work: your site should also link internally, publish sitemaps and emit canonical annotations using the HTTPS WWW URLs.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Prepare the domain before changing traffic

Make sure both hostnames resolve to the redirecting service

The apex name must reach the server, reverse proxy, CDN or load balancer that will issue the redirect. If DNS sends example.com somewhere else, your web-server rule will never run. Keep the existing WWW record serving the site while you test the apex route.

Cover the apex name with TLS

Browsers negotiate TLS before they can receive an HTTPS redirect. Therefore the certificate presented for https://example.com must include example.com (and, if applicable, its relevant wildcard or alternate names). A certificate that covers only www.example.com cannot safely redirect HTTPS requests for the apex hostname; visitors will see a certificate warning before the redirect is returned. If TLS terminates at a CDN or load balancer, configure the certificate there and forward the request to the redirect rule.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inventory paths and query strings

Choose representative URLs before deployment: the home page, a deep article, a URL with a trailing slash, a URL with a file extension and a URL containing a query string. The destination should keep the path and query parameters unless you intentionally map a path elsewhere. Do not redirect every request to the home page; that hides missing pages and can create poor search results.

Choose where the redirect runs

Implementation Control level TLS requirement for the apex Path and query preservation Best fit
Apache virtual host Direct server configuration Certificate must cover the apex on port 443 Use a host redirect that retains the original request; verify query handling Sites administered with Apache
NGINX server block Direct server or reverse-proxy configuration Certificate is required when the block listens on 443 $request_uri retains path and query string Sites administered with NGINX
Managed edge rule CDN or load-balancer dashboard Certificate is managed at the edge Configure a wildcard source and an explicit path back-reference; preserve query strings Owners without web-server access or with centralized edge routing

Prefer the layer that receives the request first. If an edge platform redirects the apex, do not add a second hostname redirect behind it. One direct response is easier to monitor and avoids extra latency.

Apache: create a dedicated apex virtual host

Use a virtual host whose only job is to redirect the apex hostname. Apache’s canonical-host pattern uses a permanent redirect and keeps the site’s hostname consistent for search engines and cookie scope.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
<VirtualHost *:443>
    ServerName example.com
    # The certificate used here must cover example.com.
    Redirect permanent / https://www.example.com/
</VirtualHost>

Place the rule in the virtual host for example.com, not in the content-serving virtual host for www.example.com. The Redirect permanent directive returns a permanent redirect and maps the path after the slash to the destination path. Confirm on your Apache version and hosting stack that query parameters are retained; some control panels or additional rewrite directives can alter that behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Handle both HTTP and HTTPS

If Apache receives traffic directly on both ports, create equivalent redirect hosts for port 80 and port 443. The port-80 host can redirect to HTTPS WWW, while the port-443 host must still have a valid apex certificate so the TLS handshake succeeds:

<VirtualHost *:80>
    ServerName example.com
    Redirect permanent / https://www.example.com/
</VirtualHost>

<VirtualHost *:443>
    ServerName example.com
    # Install a certificate that includes example.com.
    Redirect permanent / https://www.example.com/
</VirtualHost>

Reload Apache using your operating system’s normal service command only after validating the configuration. Keep the existing WWW virtual host separate so the final request returns the page rather than another redirect.

NGINX: return the canonical URL from an apex server block

NGINX can perform the redirect before it selects application content. A minimal block is:

server {
    listen 80;
    listen 443 ssl;
    server_name example.com;
    return 301 https://www.example.com$request_uri;
}

$request_uri contains the original path and query string, so a request such as /products?a=1 is sent to the same path and parameter on the WWW host. Use a certificate covering example.com for the TLS listener, or terminate TLS at an edge proxy that owns the certificate and applies the redirect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Many installations use separate HTTP and HTTPS blocks so certificate settings are explicit:

server {
    listen 80;
    server_name example.com;
    return 301 https://www.example.com$request_uri;
}

server {
    listen 443 ssl;
    server_name example.com;
    ssl_certificate     /path/to/apex-certificate.pem;
    ssl_certificate_key /path/to/apex-private-key.pem;
    return 301 https://www.example.com$request_uri;
}

Test the configuration with NGINX’s syntax checker, reload it gracefully, and verify that the WWW server block does not point back to the apex name.

Cloudflare or another edge platform

A managed edge rule is useful when you cannot edit Apache or NGINX. The rule must match every path on the apex hostname, construct the corresponding WWW URL and keep the query string.

  • Source pattern: https://example.com/*.
  • Target: https://www.example.com/${1}, where ${1} is the captured path.
  • Status: 301.
  • Query string: enable preservation.

Replace the example hostname with your real domain before activating the rule. Ensure the edge certificate includes the apex name, and check rule order so a broader redirect or page rule does not run first. If the edge also performs HTTP-to-HTTPS redirects, configure one rule that reaches HTTPS WWW directly where the platform supports it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the right HTTP status code

Status Meaning for this change When to use it
301 Permanent redirect Standard choice for a permanent apex-to-WWW move
308 Permanent redirect that preserves the request method Useful when method preservation matters and your infrastructure supports it consistently
302 Temporary redirect Short-lived testing or a temporary campaign; it does not express a permanent canonical move
307 Temporary redirect that preserves the request method Temporary changes where method preservation is required

Google treats permanent redirects as a canonicalization signal, while temporary redirects leave the source URL eligible to remain in search results. Do not use a temporary code for a hostname policy you intend to keep.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Align the rest of the site with HTTPS WWW

Redirects are strongest when every other signal agrees with them. After the server rule is live:

  • Change navigation, images, scripts, stylesheets and structured-data URLs to HTTPS WWW addresses where absolute URLs are required.
  • Regenerate the XML sitemap so every listed URL uses the WWW hostname.
  • Set each page’s rel="canonical" annotation to its HTTPS WWW URL, including the correct path and any deliberate parameter policy.
  • Review hreflang, Open Graph, RSS and feed URLs if your site publishes them.
  • Update analytics, webmaster-property settings, API allow-lists, CORS rules, cookie domains and monitoring checks that distinguish hostnames.

Do not submit a sitemap containing apex URLs and expect the redirect alone to correct it. Consistent internal references reduce crawling of obsolete hostnames and make the intended canonical destination unambiguous.

Verify the redirect before and after launch

  1. Request http://example.com/, https://example.com/ and a representative deep path.
  2. Inspect the first response. It should be a single 301 or 308 whose Location is the matching https://www.example.com/... URL.
  3. Test a query string such as /products?a=1 and confirm that both the path and a=1 arrive at the WWW URL.
  4. Request the final WWW URL and confirm it returns the page response without another hostname redirect.
  5. Repeat the test with a non-existent path. It should redirect to the equivalent WWW path, then return the normal not-found response; it should not be forced to the home page.
  6. Check that HTTP-to-HTTPS and apex-to-WWW rules do not create a two-step chain, loop or redirect back to the apex.
  7. Use a browser with a clean cache or an HTTP inspection tool to confirm the certificate presented for the HTTPS apex includes the apex name.
  8. Regenerate the sitemap and inspect page source for the HTTPS WWW canonical annotation.

A direct one-hop response is the desired result. A chain such as HTTP apex → HTTPS apex → HTTPS WWW can work, but combining the policies into one response is faster and simpler to troubleshoot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failures and fixes

Certificate warning on HTTPS apex requests

The redirect rule is not reached until TLS succeeds. Install a certificate containing the apex hostname at the server or edge layer that accepts port 443 traffic. Do not solve this by telling visitors to bypass the warning.

Redirect loop

Check the hostname seen by the application when a proxy is in front of it, and inspect both the apex and WWW rules. A loop usually means the WWW virtual host is matching the apex request, the proxy is rewriting the host unexpectedly, or the destination itself redirects back to the apex. Test each layer separately and make the edge the single authority for the host redirect.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Path or query string disappears

On NGINX, include $request_uri. In Apache, use the host-level redirect and confirm that later rewrite rules do not replace the path or discard the query string. In an edge rule, capture the wildcard path and enable query-string preservation.

Two or more hops remain

Inspect the Location header from each response. If HTTP-to-HTTPS is handled separately from apex-to-WWW, change the first rule to target HTTPS WWW directly where possible. Remove duplicate redirects from the application, control panel and CDN.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some assets or APIs still use the apex

Search templates, configuration files, JavaScript bundles and deployment variables for the old hostname. Update absolute URLs and third-party callback allow-lists. Keep the redirect in place for old links, but do not rely on it for high-volume internal requests.

Search results do not change immediately

There is no authoritative fixed number of days for complete Google consolidation after a hostname change. Google must recrawl and reprocess the affected URLs, and timing varies with crawl and indexing activity. Monitor both hostnames in your search and server reports for crawl errors, redirect loops and unexpected status codes rather than assuming an exact deadline.

Plan rollback and ongoing monitoring

Save the previous virtual-host or edge-rule configuration before deployment. A rollback should remove the new apex redirect without deleting the certificate or DNS records needed to restore service. Keep an uptime check for each of the four important combinations—HTTP apex, HTTPS apex, HTTP WWW and HTTPS WWW—and alert on anything other than the expected redirect or final page response.

After launch, periodically crawl a sample of old links and inspect logs for requests still generating redirect chains. Retain the apex redirect for as long as external links, bookmarks and cached results may point to it; changing the policy again without a migration plan can recreate the same split-host problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended end state

Every hostname variant should converge directly on HTTPS WWW, with the original path and query string intact. The WWW server should then serve the content, while internal links, sitemaps and canonical annotations all name that same host. This arrangement gives visitors one predictable address and gives search engines a consistent canonical signal without requiring application-level redirects on every page.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.