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

时间:2010-02-23 04:56:56

标签: mod-rewrite

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

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

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

非常感谢! 康平

1 个答案:

答案 0 :(得分:2)

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

在.htaccess

中尝试以上几行
相关问题