You might have seen this kind of blog elsewhere and wondering “why the hell is this blog written here?”, I’m going to answer you that question right away but with another question: Does
yoursite.com properly redirect you to
www.yoursite.com? If yes, you have no need reading this tutorial but if you recived a 404 error page then you need an answer.
The Problem?
wondering why
www.yourdomain.com works but not
yourdomain.com? You host your blog at blogger.com and wish to use “yourdomain.com”. You already have purchased your favourite domain name yourdomain.com from a
domain name provider.
In Blogger.com, you have setup your custom domain in Settings => Publishing => Advanced Settings. You have included your domain name as “www.yourdomain.com” and setup your DNS record for your domain. It works good when visitors attempt to access “www.youdomain.com”.
The issue starts when your visitor types in “yourdomain.com” without the www prefix. It does not show your blog!
Solution:
- Goto Settings => Publishing
- From the publishing group =>www.yoursite.com click edit
- Tick this checkbox: “Redirect yourdomain.com to www.yourdomain.com”
- Now click save and check http://yoursite.com
Demo:
If you desire to see how this works before you implement the answer, I purchased our new new domain name from godaddy and was fraustrated for a while when I dicovered that my site wasn’t redirectly properly… but now, it is.
Check it out https://www.ewtnet.com – without the www, ofcourse 🙂 See the redirection work and take you to www.eobasi.com
Still Not Working?
You tick the checkbox in the Advanced Settings: “Redirect yourdomain.com to www.yourdomain.com”.
You save it with anticipation of overcoming the issue, but you profit an error. Don’t panic, we have an answer!
The Simple Solution!
Learn by example: Assuming you purchased the domain from GoDaddy.com
You have already configured the DNS records in GoDaddy.com so I believe you are familiar with the basic tabs and menus once you login to your GoDaddy account. Now the only objective you have is to do a configuration which would permit visitors to be redirected to “www.yourdomain.com” when they access “yourdomain.com”
- From Hosting menu choose “My Hosting Account”.
- Click “Manage Account” corresponding to the domain you would like to redirect.
- Go to “Content” and click on the icon “Site Redirects”
- Click to create a New Redirect
- In the popup and “From” portion type the Domain: yourdomain.com; Path: depart this blank; Redirect: choose “Only without” www. prefix (Note: This domain must be associated to your hosting account in order to do this)
- Press Next and in the “To” tab, select http and type the Domain: www.yourdomain.com; path: depart this blank. Click Next
- In the Extras tab: Type: pick Permanent 301; Content redirect options: Choose No redirect.
- Ok and you are done!
In the browser type “yourdomain.com” and you would be redirected to “www.yourdomain.com”
Note: If you have purchased the domain from any hosting provider you should see a similar option to configure the redirection. If there is no option, you could use the redirect solution mentioned under where .htaccess file needs to be updated: In the home folder of /public_html there exist a file named .htaccess. If it doesn’t exist we can crate it from create new file option.
In certain file browsers like cpanel we need to highlight the show hidden files option. Then only we can see the .htaccess file.
Then add the following line of codes to that file.
RewriteEngine OnRewriteCond %{HTTP_HOST} ^yourdomain.comRewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
If you can add the file or can’t see the file,
Then create a text file and put this code in that file and finally upload the file to the server. then rename it to .htaccess.
Redirect Solution for any Linux hosting
You can apply this solution to any Apache webserver
Locate the .htaccess file in your websites root directory. You can access the website root and the file through any file explorer in cpanel provided by your hosting provider or through a ftp tool, like filezilla.
If there is no .htaccess file then create one or rename htaccess.txt to .htaccess
In the file add the following lines:
Options +FollowSymlinks
RewriteEngine upon
rewritecond %{http_host} ^yourdomain.com [nc]
rewriterule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc]
Remember to withhold the file.
Thats it! The redirection would work now.
Reader Feedback & Questions
Was this post helpful to you? Do give your feedback in the comments section below. And remember: please keep your comments relevant, and avoid spamming and/or promoting your own blog/business. Thank you 🙂
Getting Started
Did you get the answer you were searching for?
Save hours of searching online or wasting money testing unnecessary plugins, get in touch with me and let's discuss a suitable plan for your project. Best thing about this service is that you are never placed on hold and get to talk to an expereinced Oxwall/Skadate developer.
Get Answers for Free!
Ask a question related to this topic and get immediate answers from other community members in 48hrs or less. Contribute by answering members questions.
Ask Question
Premium Service
Whether it's a custom plugin, theme or dedicated support needed to get you started on your project, get professional 24/7 support tailored to your need.
Get in Touch
Or just leave a comment...
|