0

目前我在 glassfish 服务器上运行的 netbean 项目正在显示 http://localhost:8080/projectname/index.html

我需要将其更改为 http://localhost:8080/homepage

如何在标题栏中更改此 url。

或者是制作需要加密的 .htaccess 文件的唯一方法,方法是将 .htpasswd 放在 WEB-INF 等中。或者也许有一个插件。

让我知道,提前谢谢

戴夫

4

1 回答 1

0

我已经通过在 HTML5 中使用解决了这个问题,history.pushstate(null, "title", new url") 这只重命名了 index.html index-1 等。所以在 netbeans 中,如果你右键单击项目 --> 转到属性 --> 并转到 RUN... 你可以更改上下文路径并删除项目文件夹,这样你就http://localhost:8080/homepage不会http://localhost:8080/project/homepage.

为此,我需要一些谷歌没有提供的进一步建议。我想重定向到页面中的锚标记,例如href=" /index6.html#content". 然而,使用 history.pushstate() 意味着锚标记被忽略,并将始终将页面定向到 pushstate 值。无论如何围绕这个?

此致

大卫

于 2013-07-19T17:03:50.987 回答