1

I put inside the public_html/ .htaccess code (at the begining)

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

and https:// was forced with success.

But i put on the public_html/subdomain/ .htaccess code (at the begining)

     RewriteEngine On
     RewriteCond %{HTTP_HOST} ^subdomain.domain.com$
     RewriteCond %{REQUEST_URI} !^/subfolder/
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^(.*)$ /subfolder/$1
     RewriteCond %{HTTP_HOST} ^subdomain.domain.com$
     RewriteRule ^(/)?$ subfolder/index.php [L]

and the subdomain get's messy.

What is wrong about this code i put in the subdomain?

I can't do anything more. Some expertise is needed.

Thank you.

1 Answers1

1

Create your new .htaccess file with the following code in your sub folder.

RewriteEngine On

RewriteCond %{HTTP_HOST} ^demos.9lessons.info$ RewriteCond %{REQUEST_URI} !^/demos/ RewriteRule (.*) /demos/$1

RewriteEngine On

RewriteCond %{HTTP_HOST} ^labs.9lessons.info$ RewriteCond %{REQUEST_URI} !^/labs/ RewriteRule (.*) /labs/$1