Skip to content

Redirect www to non www URL using cloudfront and lambda@edge

Notifications You must be signed in to change notification settings

achakote/RedirectURL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Redirect www to non www URL using Cloudfront and Lambda@Edge

  1. Create an empty aws S3 bucket.

  2. Create the lambda function in us-east-1 since it will be used for cloudfront using redirecturl.js.

  3. Publish the new version of this lambda function.

  4. Create a Cloudfront distribution on this bucket using cname containing www

  5. In Cloudfront distribution, while creating Behavior, In Lambda function associations choose below values

      Event Type          -   Viewer Request
      Lambda Function ARN -   arn:aws:lambda:us-east-1:ACC_ID:function:FUNCTION_NAME:PUBLISHED_VERSION 
    

About

Redirect www to non www URL using cloudfront and lambda@edge

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published