• 5
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

SSL folder redirection issue - ubuntu 16.04/Apache 2.4

We have enabled ssl to a website. If we enter "https://example.com/" (with htpps://), it pointing to the right folder. Without https://(example.com) its pointing to the root folder(/var/www/html). How to point both to the right folder "/var/www/html/example.com/public_html"?

.conf as follows

<Directory /var/www/html/example.com/public_html>
    Require all granted
</Directory>

<VirtualHost xx.xx.xx.xx:443>
        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/example.crt
        SSLCertificateKeyFile /etc/apache2/ssl/example.key
        SSLCACertificateFile /etc/apache2/ssl/example.cer

        ServerName example.com
        ServerAlias www.example.com
        ServerAdmin test@example
        DocumentRoot /var/www/html/example.com/public_html

        ErrorLog /var/www/html/example.com/logs/error.log
        CustomLog /var/www/html/example.com/logs/access.log combined

</VirtualHost>

Adding the follollowing to the config should do it (unless the ServerName or ServerAlias directives with value example.com is already defined somewhere earlier in a VHost):

<VirtualHost *:80>
        ServerName example.com
        ServerAlias www.example.com
        ServerAdmin test@example
        DocumentRoot /var/www/html/example.com/public_html
        ErrorLog /var/www/html/example.com/logs/error.log
        CustomLog /var/www/html/example.com/logs/access.log combined
</VirtualHost>
  • 0
Reply Report

Trending Tags