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

226
Views
Subdomain always redirect to main domain

I'm using Let's Encrypt for my domain. I created config for example.com, www.example.com, app.example.com The example.com and www.example.com are working fine and they are pointing to /var/www/html, but the app.example.com is always redirecting to example.com which is supposed to point to /var/www/app

Here is my ssl.conf

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName example.com
        ServerAlias www.example.com
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLEngine on
        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>
        BrowserMatch    "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/example.com-0001/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com-0001/privkey.pem
    </VirtualHost>

     <VirtualHost *:443>
                ServerAdmin webmaster@localhost
                ServerName app.example.com
                DocumentRoot /var/www/app
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
                SSLEngine on
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
        <Directory /var/www/app>
                  Order allow,deny
                  allow from all
        </Directory>

                BrowserMatch    "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
                BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
                Include /etc/letsencrypt/options-ssl-apache.conf
                SSLCertificateFile /etc/letsencrypt/live/app.example.com/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/app.example.com/privkey.pem
        </VirtualHost>
</IfModule>

I am confused about what has missed here!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The problem is fixed. The subdomain was set on 2 different certificates, so when I generated a separate certificate only for the subdomain, the problem is solved.

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!