如何使用 mod_rewrite 提供 RESTful URL,隐藏我的脚本名称?

发布于 2024-08-22 04:22:50 字数 210 浏览 3 评论 0原文

我刚开始使用 mod_rewrite。有人可以告诉我如何将此网址更改

http://example.com/blog/index.html?page=1

http://example.com/blog/page/1

非常感谢!
耕平

I'm new to using mod_rewrite. Could some one tell me how to change this url

http://example.com/blog/index.html?page=1

to

http://example.com/blog/page/1

Thanks a bunch!
Kohei

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凝望流年 2024-08-29 04:22:50
RewriteEngine  on
RewriteBase   /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.html?page=$1 [L,QSA]

在 .htaccess 中尝试上面的行

RewriteEngine  on
RewriteBase   /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.html?page=$1 [L,QSA]

try the above lines in your .htaccess

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文