How do I use /folder/ URL? (Apache, Ubuntu)

November 7, 2016 2.4k views
Apache LAMP Stack Getting Started Ubuntu 16.04


On my site, I have an article located at: but how do I make a file that could be accessed through I tried adding a second index.php file in the /ee/ folder but that didn't work.

An example from DO:
Here's an URL for an article:
But, here's the URL for an index of all articles:

I'm using Ubuntu with Apache.

1 Answer

On a standard LAMP server (where you do not have rewrites for pretty URLs enabled in software like WordPress) creating a file called index.html or index.php in that directory on your server should do the trick. You can also check the DirectoryIndex variable in your virtualhost configuration in /etc/apache2/sites-enabled/ to make sure that the filename you are using is listed. Apache will look for the filenames in that directive (usually index.html, index.php, etc) when the directory itself is requested.

  • Hi, using index.php in that directory doesn't work for me. Here's the error I get: "AH01630: client denied by server configuration: /var/www/html/ee/.php" according to my error.log file.

    This is my default.conf code:
    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
            DirectoryIndex index.html index.php
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

    RewriteEngine on
    RewriteCond %{SERVERNAME}
    RewriteRule ^ https://%{SERVER
    NAME}%{REQUEST_URI} [END,QSA,R=permanent]


Have another answer? Share your knowledge.