Search code examples
phpapachedrupalvirtualhostbitnami

drupal website locahost subdirectories pages 404 error


I have created a virtual host for a drupal website on Windows 10 using Bitnami (WAMPstack), and when start the website , i can access to the home page only but not to sub pages or sub-directories.

in the windows etc folder i did update the hosts file and added

127.0.0.1       website.local

also edited the httpd.conf enabled the virtual host

(Include conf/extra/httpd-vhosts.conf)

also edited the httpd-vhosts file : added the follwoing

<Directory C:/vhosts>
  Require all granted
</Directory>

<VirtualHost *:80>
  DocumentRoot "C:/Bitnami/wampstack-7.1.15-0/apache2/htdocs/website/"
  ServerName website.local
</VirtualHost>

when i start browsing the site and click on any subpage i got a 404 (Not Found) please advise.


Solution

  • Seems like you are missing some directives on the directory level. Here is a config that works that basically follows https://www.drupal.org/node/953296#comment-9866119

    <VirtualHost *:80>
    
        DocumentRoot /home/myrepo/mydocroot
        ServerName mysite.localhost
    
        <Directory /home/myrepo/mydocroot >
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    
    </VirtualHost>