So I’ve spent one too many hours on this- getting a bit desperate.
.htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^submit/?$ submit.php [NC,L]
/etc/apache2/sites-available/applicapple:
<VirtualHost *:80>
ServerAdmin support@perpetualcontrast.com
DocumentRoot /var/www/applicapple
ServerName applicapple.localhost
<Directory /var/www/applicapple/>
Options Indexes FollowSymLinks MultiViews
RewriteEngine On
AllowOverride All
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
submit.php definitely exists. while visiting applicapple.localhost/submit :
With submit.php in the directory, I get The requested URL /submit was not found on this server.
If I remove submit.php, I get The requested URL /submit.php was not found on this server.
If I visit localhost/applicapple it works as expected.
Can someone clue me into what is going on here?
The problem was the MultiViews option in Apache which searches the directory for files with the same name, so /submit gets interpreted as /submit.php if /submit.php exists. I turned off this option and it works as expected now.