WordPress is a favorite content management system (CMS) for many website owners and bloggers. After purchasing a domain name and before pointing it to your server space, you need to consider one question: “Do you want to use a root domain (non-www), or a subdomain prefixed with www?”
A root domain (also known as a naked domain), for example our VEDFOLNIR.com (top-level domains refer to extensions like .com and .net).
A subdomain, also known as a prefixed domain, such as WWW.vedfolnir.com or MAIL.vedfolnir.com, can be routed and assigned via CNAME records. This is suitable for different service applications and convenient for webmaster management, such as email (MAIL) or file transfer (FTP).
If you want to use a WWW-prefixed domain in your WordPress setup, you can edit the .htaccess file in your system’s root directory and configure it as follows:
Standard WordPress .htaccess Configuration
The configuration here is the default .htaccess file setup after installing WordPress for the first time:
BEGIN WordPress
RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
END WordPress
If you want to redirect a non-WWW domain to a WWW subdomain, besides assigning WWW to the “LocalHost” host or ”@” symbol via CNAME records in your DNS management, you also need to modify the configuration above in .htaccess to the following setup.
Redirect Non-WWW Domain to WWW Domain (non-www to www) Configuration
The complete .htaccess configuration is as follows (please replace Vedfolnir.com in the link with your own domain):
BEGIN WordPress
RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} !^www. RewriteRule (.*) https://www.vedfolnir.com%{REQUEST_URI} [L,R=301] RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
END WordPress by Mountos.com
Support Independent Perspectives & In-Depth Insights
Every thoughtful analysis and candid critique comes from our dedication to truth and quality. We choose not to follow sensational algorithms or clickbait headlines.
Sustaining independent research requires reader support. Make a one-time or monthly contribution, securely processed by Google.
Payments secured by Google · Manage or cancel anytime in your Google Account

Comments