Can';Apache2.4上的t别名URL

Can';Apache2.4上的t别名URL,apache,apache2,apache2.4,Apache,Apache2,Apache2.4,我基本上是想把localhost重定向到localhost/index.html。我尝试过反向代理和使用别名,但都不起作用: ProxyPass”/“/index.html”返回一个错误,指出路径必须是绝对路径,因此我尝试了ProxyPass”/http://localhost/index.html“,以及用我的内部IP替换localhost,但两者都会导致网页永久加载 Alias”/“/index.html”在尝试访问localhost和localhost/index.html时出现403错误

我基本上是想把
localhost
重定向到
localhost/index.html
。我尝试过反向代理和使用别名,但都不起作用:

ProxyPass”/“/index.html”
返回一个错误,指出路径必须是绝对路径,因此我尝试了
ProxyPass”/http://localhost/index.html“
,以及用我的内部IP替换
localhost
,但两者都会导致网页永久加载

Alias”/“/index.html”
在尝试访问
localhost
localhost/index.html
时出现403错误。如果我不使用别名或其他任何东西,我可以访问
localhost/index.html
,这让我觉得别名没有重定向到我想要的位置,但我不知道它重定向到了哪里。my
apache2.conf
的目录部分如下所示:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

<Directory /var/www/mundane.tk/public_html/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
我曾尝试将我的html移动到默认的
/var/www/html/
文件夹中,但也出现了同样的问题。我已将目录所有权授予
public\u html/
文件夹,并将其所有子目录授予apache的组和用户
www-data


说到apache,我是一个新手,所以我可能忽略了一些显而易见的东西;如果是这样的话,我深表歉意。

您正在寻找的是一个永久性的指令。@Capsule刚刚尝试过;我可能格式有误,但现在它从
localhost
重定向到
localhost/index.htmlindex.htmlindex.html…
。问题是/is index.html。我甚至不明白你为什么;We’我们正在尝试这样做,希望让URL更丑陋是的,我知道这是注定的,但它的行为不是这样的:我必须导航到
localhost/index.html
才能获得我的索引页面。我希望这与我的虚拟主机的设置有关,但我真的不知道。我知道我以前有过这样的功能,但是我的
modules
文件夹随机消失了,所以我不得不重新安装,现在它不工作了。如果根文件夹中还有另一个
index.htm
index.php
文件,那么它可能会首先选择它,具体取决于DirectoryIndex指令的顺序。这是你需要解决的问题,而不是从一开始就进行黑客攻击。少就是多。
DocumentRoot /var/www/mundane.tk/public_html/

<Directory /var/www/mundane.tk/public_html/>
    AllowOverride All
    Require all granted
</Directory>