I have a windows environment using WAMP where this works fine. I am just setting up my Ubuntu desktop development environment, and this particular mod_rewrite is not working.
It's pretty basic, but if I go to
example.local/files/a-real-file.pdf
I get a 404 not found
from apache. If I go to
example.local/files.php/a-real-file.pdf
the file will display, as expected. If I go to
example.local/files.php/non-existing-file.who.cares
I get a var_dump($thelink)
as expected from my files.php
logic.
the .htaccess
in my web root
RewriteEngine On
RewriteRule ^files/(.*)$ files.php/$1
my apache vhost config
<VirtualHost *:80>
ServerName reqapp.localhost
DocumentRoot /var/www/html/aaApp/public_html
<Directory /var/www/html/aaApp/public_html/>
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
and for good measure, the "localhost" conf
<VirtualHost *:80>
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
as well as the "applicable" part of apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
according to phpinfo()
mod_rewrite
is loaded. If a create a syntax error in the .htaccess
file, the site does crash.
I don't know where else to look. I can't fine any other .conf
files in and of the "{mods|conf|sites}-enabled" files that should be effecting this directory.
It might be worth mentioning that I also have a Joomla instance running, and the SEF is working fine with it.