I'm developing a symfony application and in trying to remove index.php from the url, I used the following virtualhost configuration:

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        DocumentRoot "/var/www/html/experiments-1/public"

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined


The localtion of the site is confirmed as /var/www/html/experiments-1/public/index.php.

But when I visit http://localhost:81/ I just get the default symfony page.

I would appreciate some insight into what I'm missing or doing wrong.

  • Did you reload/restart after making the configuration change? Is that the only active configuration file? Add the log entry for the access to your question. Nov 14, 2021 at 13:12
  • @HaukeLaging: Yes. I did execute "service apache2 reload" after the configuration change
    – sisko
    Nov 15, 2021 at 21:54
  • Do you not use the listen 80 directive at the top of your script as seen here?
    – Nate T
    Nov 15, 2021 at 22:49
  • @NateT: Including that "Listen 80" statement results in an apache syntax error
    – sisko
    Nov 16, 2021 at 0:58

1 Answer 1


Your configuration is for port 80 but you access port 81.

  • I am using a docker container for building the site. So port 81 is the external port but I kept the internal port as 80. However, I did rebuild the container using 80:80 as the external:internal port but I still don't get the experiments-1 site responding at localhost
    – sisko
    Nov 12, 2021 at 11:27

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.