apache代理重写https://my.domain.fr/状态为404

发布于 2025-01-22 15:02:02 字数 399 浏览 4 评论 0原文

我需要你帮忙。 我有一个HTTPD反向代理,我需要将所有返回404状态的所有内容重定向到主页。

我已经配置了这样的VHOST文件:

   ```
    RewriteEngine On
    RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [R=404]
    #ErrorDocument 404 http://%{HTTP_HOST}/

但是我不起作用。 而不是返回主页,而是返回此消息:

The requested URL / was not found on this server.

PS:我不使用HTACCESS文件,我只想使用VHOST文件使其正常工作。 你能帮我吗? 先感谢您。

I need you help please.
I have an httpd reverse proxy and I need to redirect everything that return 404 status to the main page.

I have configured my vhost file like this:

   ```
    RewriteEngine On
    RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [R=404]
    #ErrorDocument 404 http://%{HTTP_HOST}/

But I does not working.
Instead of returning the main page It return this message:

The requested URL / was not found on this server.

ps: I don't use htaccess file I just want to make it work using vhost file.
Can you help me please ?
Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文