0

I now have my main domain working fine. I have 5 other independent domains that I am trying to map onto my main domain as sub-domains. I also have a wild-card certificate to cover the 4 of those subdomains. So I am rehashing htaccess and optimising it. This is what I have for the main domain .software and seems to be working fine.

#software
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(www\.)?example\.software$ [NC]
RewriteRule ^ https://example.software%{REQUEST_URI} [R=301,L,QSA]

For the sub-domain I have to break it up. I figured that I want the redirection to https to be hard, so I have this

#online
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(www\.)?example\.online$ [NC]
RewriteRule ^ https://example.online%{REQUEST_URI}  [R=301,L,QSA]

For the second part, this works fine.

RewriteCond %{HTTP_HOST} ^example\.online$ [NC]
RewriteRule ^ https://other.example.software%{REQUEST_URI}  [L,QSA]

But I dont want the browser to show other.example.software, instead I would like to show example.online. The question is, is this possible ? Because when I try this, I get Server Error. Elsewhere in cpanel, I have other.example.software mapped to the folder example.software/online.

RewriteCond %{HTTP_HOST} ^example\.online$ [NC]
RewriteRule ^ other.example.software%{REQUEST_URI}  [L,QSA]

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@pacificblue.software to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Unfortunately, in cpanel I cant seem to find the logs for .online and the error logs for .software don't show anything.

3
  • What does "mapped to a subdomain" actually mean? Does that mean you are using CNAME records to those subdomains? Does that mean that the content used to be hosted on subdomains and you want to move it? Does that mean that you are using redirects of some sort? Dec 14, 2021 at 16:29
  • The hosting company did it, looking at the records, they have either used "Name Servers" or "A Record" or both. I am not moving content, its brand new. Its to avoid separate hosting fee for each domain and the security certificate is cheaper for subdomains. I am starting to get the feeling that I am mis-using the concept of sub-domain. Dec 15, 2021 at 3:48
  • If you want to use alternate domains with HTTPS you will need to get security certificates for each of them. You won't be able to piggy-back off your subdomain certificates. Dec 15, 2021 at 10:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.