dtv11049 2018-04-01 10:51
浏览 219

Apache2:AH01630客户端在重写后被服务器配置拒绝

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!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 fluent的在模拟压强时使用希望得到一些建议
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样
    • ¥15 java的GUI的运用
    • ¥15 Web.config连不上数据库
    • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
    • ¥15 怎么配置广告联盟瀑布流
    • ¥15 Rstudio 保存代码闪退