I'm trying to get the .php
extension to not be required when you view a php file. My current config is the following:
<VirtualHost *:80>
DocumentRoot /var/www/server
ServerName localhost
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteRule ^([^/\.]+)/?$ $1.php [L,QSA]
</VirtualHost>
However, it doesn't work as I'm getting 404's when I try access a files like login.php
as login, for instance. My server setup is kind of strange, in the /var/www/server
is a symbolic link to another folder Dev/server/
. Also, since it's localhost
, I'm accessing it via localhost/project/login.php
.