gpt4 book ai didi

java - Apache http 服务器重写 url 失败

转载 作者:行者123 更新时间:2023-11-30 04:57:45 25 4
gpt4 key购买 nike

我想将http://www.example.com/index.htm重定向到本地文件:/home/admin/mf/htdocs/default.htm在httpd.conf中配置apache服务器如下,但它不起作用,有什么问题与我的配置?

Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /home/admin/mf/htdocs
RewriteEngine on
RewriteRule ^/index.htm /default.htm
</VirtualHost>

最佳答案

您可能缺少 <Directory>文档根目录 /home/admin/mf/htdocs 的指令:

<Directory /home/admin/mf/htdocs>
Order allow,deny
Allow from all
<Directory>

有关更多信息,请参阅here .

关于java - Apache http 服务器重写 url 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7995139/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com