How to redirect www urls to non


Why Redirect khổng lồ www or non-www?

Running your website on www or non-www URLs may be for aesthetic reasons, personal preference or to prsự kiện redundant hostnames. It is recommended that you keep the hostname of your website the same throughout. Either with the www part or without the www part.

Bạn đang xem: How to redirect www urls to non

In WordPress, you have a homeurl & siteurl so the redundant hostnames issue is not a problem since WordPress will automatically redirect to ensure that the site is running on the same siteurl as it should be. Other applications may require your attention in this area though.

Google Analytics will also give you a “Redundant Hostnames” warning if you don’t.

You want khổng lồ vì chưng a permanent, HTTPhường 301 redirect for this.

How lớn Redirect khổng lồ www or non-www

There are two quiông xã & easy ways of doing this on our servers.Pichồng one of the two methods that you prefer to lớn use. The first one is the easiest for most users.

Xem thêm: Facebook Được Viết Bằng Ngôn Ngữ Gì ? Python Là Gì

1. Using cPanel lớn Redirect to lớn www or non-www

This is easy khổng lồ bởi with cPanel. Log in to lớn your cPanel lớn get started.

Go to lớn Domains > Redirects on the cPanel main page.

Now depending on whether you prefer the URLs with the www part or without the www part, the instructions will differ a bit.

Redirect khổng lồ www


Set the type to lớn permanent which will give an HTTP 301 status code.Choose your main domain in this drop down.Leave sầu the path empty, you want to redirect the entire domain.Specify the URL khổng lồ redirect to lớn with the “www” part in it.Choose “Do Not Redirect www“.Leave sầu the “Wild Card Redirect” unchecked.Redirect khổng lồ non-www


Set the type to permanent to give sầu a 301 HTTPhường status code.Select the main tên miền from the drop down menu.Leave the path empty, we want to redirect the entire tên miền.Set the URL to redirect khổng lồ without the “www” part in it.Choose “Only redirect with www“Leave sầu the “Wild Card Redirect” unchecked.

2. Using .htaccess lớn Redirect lớn www or non-www

Simply put the following lines of code into your main, root .htaccess file.In both cases, just change out tên miề to your own hostname.

Redirect khổng lồ www
.htaccess 301 redirect www, .htaccess redirect, 301 redirect, Best WordPress Hosting, cpanel, cPanel Redirect, Google Analytics Redundant Hostnames, HTTPhường 301, mod_rewrite, non-www redirect, Permanent Redirect, redirect, Redirect away from www, Redirect from non-www lớn www, Redirect from www lớn non-www, Redirect to lớn www, Redundant Hostnames, Remove www from URL, RewriteCond, RewriteRule, Same Hostname, Hosting, Software, WHM, WordPress cPanel, WordPress Hosting, WordPress non-www, WordPress Redirect, WordPress www, www htaccess, www redirect