Redirect traffic from naked domain to www using aws s3 and cloudflare

This assumes that you already have an AWS account and a Cloudflare account.

Use case – Why bother?

You have some application server or static website running on www subdomain and you want to redirect traffic from the naked domain(eg to the www subdomain(eg Why? Because :

  1. When users share your domain verbally, they then to not include www. They just say – go check out When the other user tries they get nothing
  2. SEO – generally you want to make sure everything is clean and all search results contain www subdomain

Configuration on AWS

1. Click create bucket from S3 console

Click on create bucket

Enter the naked domain as the bucket name and select a region.

Under “set permissions” tab in the bucket creation process, from the “Manage public permissions” choose “Grant public read access to this bucket”

2. Enable static site hosting and redirect to www subdomain

Click on the newly created bucket. Click on the properties tab and you will see the following.

Click on Static site hosting. In the dialog box that opens, choose option – “Redirect requests”. In the input boxes enter the target www domain(eg and the protocol.  Copy the endpoint shown in the modal. You will need to for DNS mapping. 

Configuration on Cloudflare:

1. Add a CNAME record to your naked domain

On a regular DNS router, you cant add a “CNAME record” to a naked domain. However cloudflare supports. Cloudflare internally converts that to an “A record”. It should look this when you are done. 

Thats it. Your naked domain( will now redirect to (

Book summary – Be so good that they cant ignore you

This book is written by Cal Newport.  I definitely recommend this book.


Rule #1 don’t follow your passion:

    Your current passion is a function of your current world view. Your current so called passion might not be the one that gives you the most fulfilment. You think it will. As you expand your world view you might discover a new something that you might be infact be more passionate about.

    Conclusion #1.- Career passions are rare.

        At the core of passion hypothesis is the assumption that we all have pre-existing passion waiting to be discovered.

    Conclusion #2 – Passion takes time

    Distinction between job, career, and a calling –
        A job is a way to pay the bills
        A career is a path towards increasingly better work
        A calling is work thats an important part of your life and a vital part of your identity.

    Conclusion #3 – Passion is a side effect of mastery

        Working right trumps working right trumps finding the right work.

Rule #2 – Be so good that they can’t ignore you

    The clarity of a craftsman.
        Eventually you are so experienced that there is a confidence that comes out – Martin explains. Its something that audience smells.
    Adopting the craftsman mindset
        There is something liberating about the craftsman mindset. It asks you to leave behind self-entered concerns about whether your job is just right and instead put your head down and plug away at getting really damn good. No one owes you a career., it argues, you need to earn it – and the process won’t be easy.
    The power of career capital
        Traits that define great work.
            * Creativity
            * Impact
            * Control
    If you want a great job, you need something of great value in return.
    He produced something of great value and in return his career got an inject of creativity, impact and control The more you read about ira about glass, the more you encounter a young man, who was driven to develop his skill until they were too valuable to be ignored.
    Glass exchanged a collection of hard won, rare and valuable skills for his fantastic job.
    Career capital theory of great work
        * The traits that define great work are rare and valuable
        * Supply and demand says that if you want these traits you need rare and valuable skills to offer in return. Think of these rare and valuable skills you can offer as your career capital
        * The craftsman mindset, with its relentless focus on becoming so good that they can’t ignore you is a strategy well suited for acquiring career capital. This is why it trumps the passion mindset if your goal is to create work you love.

Rule #3 – turn down a promotion.

    Giving people more control over what they do and how they do it increases their happiness, engagement, and sense of fulfilment.
    Control traps
        First control trap – Control that is acquired without career capital is not sustainable.
        Second control trap – You have become valuable enough to your employer that they will fight your effort to gain more autonomy.
    Avoiding control traps:
        Do what people are willing to pay for. Money is a neutral indicator of value. By aiming to make money, you are aiming to be valuable.

Rule #4 – Think small act big – or the importance of mission.

    Power of mission.
    Mission requires capital
    The details it turned out, did not work themselves out, leaving Jane penniless and still without a college degree.
    Mission requires little bets
        Great missions are transformed into great successes as the result of using small and achievable projects – little bets – to explore the concrete possibilities surrounding a compelling idea.
    Mission requires marketing
        Laws of remark ability