Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

429
Views
Apache, Linux 2, Elastic Beanstalk - Rewrite http and www to https non-www

I am trying to get URL rewrites as noted in the question title. I created .platform/httpd/conf.d/ssl_rewrite.conf and with the below content, I was able to get http to https rewriting successfully.

RewriteEngine On
<If "-n '%{HTTP:X-Forwarded-Proto}' && %{HTTP:X-Forwarded-Proto} != 'https'">
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</If>

I am now trying to get the www to route to non-www. I have attempted to add an || clause to that If statement by changing it to <If "(-n '%{HTTP:X-Forwarded-Proto}' && %{HTTP:X-Forwarded-Proto} != 'https') || '%{HTTP_HOST}' !~ /^www\./", but that ended up creating some www.www.example.com routes.

Can someone provide any insight? Is creating multiple statements recommended?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!