开发者

How do I use mod_rewrite to provide RESTful URLs, hiding my script name?

开发者 https://www.devze.com 2022-12-21 11:25 出处:网络
I\'m new to using mod_rewrite.Could some one tell me h开发者_开发问答ow to change this url http://example.com/blog/index.html?page=1

I'm new to using mod_rewrite. Could some one tell me h开发者_开发问答ow to change this url

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

to

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

Thanks a bunch!

Kohei


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

0

精彩评论

暂无评论...
验证码 换一张
取 消