I am new to craft CMS and installed it in an Amazon EC2 instance via Composer. This worked. My vhost.conf looks like this

<VirtualHost *:80>
ServerName craft.example.com
DocumentRoot /var/www/vhosts/viacraft/www-craft-test
ServerAdmin [email protected]
ErrorLog /var/www/vhosts/logs/error_log_viacraft
<Directory /var/www/vhosts/viacraft/www-craft-test>
        AllowOverride All
RewriteEngine On
RewriteCond %{SERVER_NAME} =craft.viainfo.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

Database setup worked and passed. Then according to the manual I called


which leads to an File not found error.

Then I put a hello.php in /var/www/vhosts/viacraft/www-craft-test but https://craft.example.com/hello.php did not worked which I did not understand. Then I put the hello.php in /var/www/vhosts/viacraft and it worked which is strange because the web directory in the vhost.conf is /var/www/vhosts/viacraft/www-craft-test and not /var/www/vhosts/viacraft/

Any ideas to this behaviour?

Then I managed to start the whole thing by entering


Why do I have to enter my webfolder www-craft-test in the path to call the dashboard???

I made my first entry - a blog and when I press Preview the following page is called


with the error

Page Not Found
Template not found: blog/_entry

I am not in development mode.

Settings/Site This site has its own base URL is UNCHECKED

This is my .htaccess in the www-craft-test folder

 <IfModule mod_rewrite.c>
  RewriteEngine On

  # Send would-be 404 requests to Craft
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
  RewriteRule (.+) index.php?p=$1 [QSA,L]

In the templates folder there is still the original index.twig file.

A bit confused, happy to get some helpful ideas?



1 Answer 1


Your virtual hosting config looks good to me. However, how are you running SSL?

You've only shown the port 80 / non-SSL config and it shows a redirect to https so the DocumentRoot probably differs between port 80 and 443 versions vhost stanzas.

Make sure DocumentRoot is the same in both places and you should be able to load up Craft without the www-craft-test prefix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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