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

315
Views
htaccess: redirect to https://subdomain.domain.com

I want to redirect my website to https://subdomain.domain.com in my .htaccess file.

Redirects:

http://subdomain.domain.com => https://subdomain.domain.com

http://www.subdomain.domain.com => https://subdomain.domain.com

https://www.subdomain.domain.com => https://subdomain.domain.com

https://subdomain.domain.com => no redirects

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

This should do it…

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
over 4 years ago · Santiago Trujillo Report

0

First rule redirect all www to https://subdomain.domain.com, second all http to https://subdomain.domain.com

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://subdomain.domain.com/$1 [R=301,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://subdomain.domain.com/$1 [R=301,L]
over 4 years ago · Santiago Trujillo Report
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!