I get this error, when trying to access a url which gets rewritten internally and I don't know why or how to fix it:
[Sun Apr 01 10:XX:XX.042734 2018] [authz_core:error] [pid 20813] [client 84.XX.XX.90:16450] AH01630: client denied by server configuration: /dev/home.php
Basically, I am trying to rewrite all html requests, so when you e.g. try to access /dev/file.html, it's rewriting it to dev/file.php
I am able to access /dev/file.php without issues, but when I try to access /dev/file.html (which should point to the .php file) I am getting a 403 Forbidden error.
I have tried several things, I found here on Stackoverflow, as well as in various blogs, but nothing helped. My current vhost conf looks like this:
<VirtualHost *:80>
ServerName www.example.com # My actual files contain the correct domain and not "example"
ServerAdmin admin@example.com
DocumentRoot /var/www/html
#Include /var/www/html/.htaccess
ServerAlias www.example.com
ServerAlias *.example.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
#AllowOverride None
Require all granted # since 2.4
</Directory>
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#Include conf-available/serve-cgi-bin.conf
# Redirects
Include /etc/apache2/redirects.conf # Doing all redirects/ rewrites here
</VirtualHost>
My redirects.conf file looks like this:
Options +FollowSymLinks
RewriteEngine on
Redirect 302 "/index.html" "http://example.com/maintenance.html"
Redirect 302 "/index" "http://example.com/maintenance.html"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)\.html$ $1.php
I am hosting the website using a virtual instance on google cloud, Ubuntu 16.04 and my Apache version is 2.4.18.
I would greatly appreciate any hint! I am normally used to Node serving, so the conf stuff in apache is quite unusual to me.
Thanks!