There are three ways to remove or add www to your domain name in Wordpress. All the three ways are detailed in the following text.
Changing the URL from WordPress Dashboard :
1. Log into the WordPress Dashboard and go to Settings >> General.
2. Find the "WordPress Address (URL)" and "Site Address (URL)" and Rewrite the URL (with WWW or without WWW) which you want to use.
3. Save the Changes and Log Out from the WordPress Dashboard.
Changing the URL by phpMyAdmin :
1. Open phpMyAdmin.
2. In left pane Click your Database.
3. Find the "wp_options" table and click on it.
4. Goto "siteurl" and "home" rows and click the pencil icon to edit them.
5. Move to the “Insert” Section and add the URL you want to use (Do this task for both “siteurl” and “home”).
6. Click the “Go” Button to save your changes (Do this task for both “siteurl” and “home”).
Removing "www" via .htaccess File :
1. Find the .htaccess File and if you can’t find it then create a new one and upload it to your root directory.
2. Add the following mod_rewrite rule to the file -:
Adding "www" via .htaccess File :
1. Find the .htaccess File and if you can’t find it then create a new one and upload it to your root directory.
2. Add the following mod_rewrite rule to the file -:
Changing the URL from WordPress Dashboard :
1. Log into the WordPress Dashboard and go to Settings >> General.
2. Find the "WordPress Address (URL)" and "Site Address (URL)" and Rewrite the URL (with WWW or without WWW) which you want to use.
3. Save the Changes and Log Out from the WordPress Dashboard.
Changing the URL by phpMyAdmin :
1. Open phpMyAdmin.
2. In left pane Click your Database.
3. Find the "wp_options" table and click on it.
4. Goto "siteurl" and "home" rows and click the pencil icon to edit them.
5. Move to the “Insert” Section and add the URL you want to use (Do this task for both “siteurl” and “home”).
6. Click the “Go” Button to save your changes (Do this task for both “siteurl” and “home”).
Removing "www" via .htaccess File :
1. Find the .htaccess File and if you can’t find it then create a new one and upload it to your root directory.
2. Add the following mod_rewrite rule to the file -:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
1. Find the .htaccess File and if you can’t find it then create a new one and upload it to your root directory.
2. Add the following mod_rewrite rule to the file -:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*) http://www.example.com/$1 [L,R]