微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 SiteGround

如何解决使用 SiteGround

在得知我的客户正在使用 SiteGround 之前,我最初在 React 中构建了我的网站,因此我不得不将所有内容更改为基本的 HTML 格式。我的导航栏使用 href = "fileName.html" 来导航页面。一旦离开主页,这会导致 URL 变为 www."siteName".com/"fileName.html"。

这是我到目前为止在我的 .htaccess 中从末尾删除 .html 的内容

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule (.*) $1.html [L]

<IfModule mod_rewrite.c>

  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule . /index.html [L]

</IfModule>

这似乎不起作用。我应该更改我的 .htaccess 文件吗?我应该更改导航栏导航页面的方式吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。