0

When I search for the subdomain.domain.es I'm redirected to domain.es. Code in htaccess file:

RewriteEngine On
RewriteBase / RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://dominio.es/$1 [R=301,L]

My hosting company gave me the htaccess so my web was redirected from http to https but I have no clue of what any of this code means. I'm new to web programming so I hope you can help.

Thanks so much!

Lovepreet Singh
  • 4,792
  • 1
  • 18
  • 36
matsrom
  • 55
  • 6
  • have you seen the answer on this question? it looks like you might need to specify some values : https://stackoverflow.com/questions/2045897/with-mod-rewrite-can-i-specify-a-rewritebase-within-a-rewritecond – john_h Jun 14 '18 at 13:10

1 Answers1

0

This answer worked for me. I hope this can help someone else!

RewriteEngine On RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

matsrom
  • 55
  • 6