How To Redirect Www To Non

      26

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 lớn prevent redundant hostnames. It is recommended that you keep the hostname of your trang web the same throughout. Either with the www part or without the www part.

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

In WordPress, you have sầu a homeurl và 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 sầu you a “Redundant Hostnames” warning if you don’t.

You want to lớn vày a permanent, HTTP 301 redirect for this.

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

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

Xem thêm: How To Fix This Site Can’T Be Reached Error In Gooogle Chrome

1. Using cPanel khổng lồ Redirect to lớn www or non-www

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

Go 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 to lớn www

*

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

*

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

2. Using .htaccess lớn Redirect khổng lồ www or non-www

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

Redirect lớn 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 to www, Redirect from www khổng lồ non-www, Redirect lớn www, Redundant Hostnames, Remove sầu www from URL, RewriteCond, RewriteRule, Same Hostname, thietkewebhcm.com.vn Hosting, thietkewebhcm.com.vn Software, WHM, WordPress cPanel, WordPress Hosting, WordPress non-www, WordPress Redirect, WordPress www, www htaccess, www redirect