HTTPS giving 404 not found error

12,390

In the <VirtualHost _default_ *:80>, you are setting:

DocumentRoot "/opt/bitnami/apache2/htdocs/domainDIR/public/"

However, in the <VirtualHost *:443>, you are setting:

DocumentRoot "/opt/bitnami/apache2/htdocs/domain/public/"

Where is your web application located? Both paths should be the same one.

Share:
12,390
Sarang
Author by

Sarang

Technology professional with over 10 years of experience in software development with 4+ years as a chief technology officer of a budding hospitality industry start-up Expertise in full-stack development, API development, API integration, cloud-based servers, payment gateways integration, version control system and project management tool Core competency in PHP, Python, AWS, Angular, Jquery, MySQL, Postgres, etc Operated as a business leader for 4 years driving all aspects within the business - finance, operations, marketing, recruitment, mentorship

Updated on June 04, 2022

Comments

  • Sarang
    Sarang almost 2 years

    I have install the SSL certification on my bitnami google cloud hosting.
    certificate has been property installed and even

    I can access :

    https://domain.com
    

    but when I try to access

    https://domain.com/xyz 
    

    its giving me 404 not found error

    Below is my binami.conf file

    <VirtualHost *:443>
      SSLEngine on
      SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
      SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"
    
      DocumentRoot "/opt/bitnami/apache2/htdocs/domain/public/"
      <Directory "/opt/bitnami/apache2/htdocs/htdocs/domain/public/">
        Options FollowSymLinks MultiViews
        AddLanguage en en
        LanguagePriority en
        ForceLanguagePriority Prefer Fallback
    
        AllowOverride All
        <IfVersion < 2.3 >
          Order allow,deny
          Allow from all
        </IfVersion>
        <IfVersion >= 2.3 >
          Require all granted
        </IfVersion>
      </Directory>
    
      # Error Documents
      ErrorDocument 503 /503.html
    
      # Bitnami applications installed with a prefix URL (default)
      Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
    </VirtualHost>
    

    Can anyone please help me, what went wrong
    For more information
    Am using google cloud platform with Bitnami LAMP stack

    • ArtisticPhoenix
      ArtisticPhoenix over 7 years
      but can you access http://domain.com/xyz that is the question, for example is that a valid url, if it's not SSL makes no difference.
    • Sarang
      Sarang over 7 years
      Yes, its a valid URL and everything is running find when I use the website without https
    • Dusan Bajic
      Dusan Bajic over 7 years
      We would really need to see .conf file for <VirtualHost *:80>, there is probably some rewriting there that is missing on https site.