0

I have vhost with following conf (localhost.conf) file (this needs to be like this in order for an app I am working on to work properly (please don't ask why I didn't make the setup)):

<VirtualHost *:80>
    ServerAdmin admin@wp.dev
    ServerName localhost
    #ServerAlias www.wp.dev
    DocumentRoot /home/sasha/Documents/Scopic/STS/project/timesheetapprovalsgit/timesheet_ui/web

    <Directory /home/sasha/Documents/Scopic/STS/project/timesheetapprovalsgit/timesheet_ui>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
        require all granted
    </Directory>
</VirtualHost>

I am trying to add new vhost (prst.conf):

<VirtualHost *:80>
    ServerAdmin admin@prst.app
    ServerName prst.app
    ServerAlias www.prst.app
    DocumentRoot /home/sasha/Documents/Scopic/PerformanceReview/project/performance-review-status-tracking/public

    <Directory /home/sasha/Documents/Scopic/PerformanceReview/project/performance-review-status-tracking>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
        require all granted
    </Directory>
</VirtualHost>

My hosts file:

127.0.0.1   localhost
127.0.0.1   www.prst.app

The main issue I have at the moment is that whenever I go to www.prst.app, I am redirected to the localhost. Does anyone have an idea what am I doing wrong here?

2

Your server name is defined as:

  ServerName prst.app

so define in /etc/hosts prst.app not www.prst.app

127.0.0.1   prst.app

To access www.prst.app create new virtual host and new record in /etc/hosts

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.