如何在不附加 html 的情况下打开站点中的网页?
How to open a webpage in a site without appending html ?
我想在网络浏览器中打开网页
www.somesite.com/myPage.html
我自己创造了myPage.html,简单html
我想通过
打开这个页面
www.somesite.com/myPage
我已将 myPage.html
放入 cpanel
的 public_html
文件夹中
选项 1
将您的文件 myPage.html
保存在 public_html
您需要在 public_html
中创建一个 .htaccess
并将其添加到文件中:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ .html [NC,L]
选项 2
- 创建文件夹调用
myPage
- 将文件
myPage.html
重命名为 index.html
- 将文件
index.html
移动到 myPage
文件夹
注意:-不要同时使用这两种方法。在使用 Option 2
之前从 .htacess
文件中删除所有数据
我想在网络浏览器中打开网页
www.somesite.com/myPage.html
我自己创造了myPage.html,简单html
我想通过
打开这个页面www.somesite.com/myPage
我已将 myPage.html
放入 cpanel
public_html
文件夹中
选项 1
将您的文件 myPage.html
保存在 public_html
您需要在 public_html
中创建一个 .htaccess
并将其添加到文件中:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ .html [NC,L]
选项 2
- 创建文件夹调用
myPage
- 将文件
myPage.html
重命名为index.html
- 将文件
index.html
移动到myPage
文件夹
注意:-不要同时使用这两种方法。在使用 Option 2
.htacess
文件中删除所有数据