apache 如何将网站首页重定向到/public/index. html路径

nfg76nw0  于 6个月前  发布在  Apache
关注(0)|答案(1)|浏览(105)

我正在做动态Web项目,以下是我的web.xml内容:

<display-name>WEBSITE_NAME</display-name>

      <welcome-file-list>
        <welcome-file>/public/index.html</welcome-file>
      </welcome-file-list>

字符串
我的问题是,当我运行项目并输入WEBSITE_NAME时,index.html文件内容出现在页面上,但没有加载存在于public/img路径中的图像,如果我手动添加到查询字符串/public/index. html,网站工作正常。问题是:当我输入其名称时,如何强制网站指向/public/index. html路径?

3duebb1j

3duebb1j1#

检查.htaccess文件中的重写(将example.com更改为您的域):

RewriteEngine On
RewriteBase /public/
RewriteRule ^(.*)$ http://example.com/$1 [L]

字符串

相关问题