更改网址为.html [英] Change URL to .html
本文介绍了更改网址为.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样才能改变这个网址
How can I change this URL
http://mysite.com/index.php?searchterm=my+great+song
到
http://mysite.com/search/my-great-song.html
我在mod_rewrite的初学者。这就是为什么我想不出该怎么办。我想AP preciate您的帮助,如果你能告诉我的.htaccess code,我应该写在.htaccess文件中更改URL。
I am a beginner in mod_rewrite. That is why I can not figure out what to do. I would appreciate your help if you can tell me the .htaccess code that I should write in the .htaccess file to change the url.
推荐答案
您可以试试这个code:
You can try this code :
RewriteEngine On
RewriteRule ^search/([^\.]+).html$ /index.php?searchterm=$1
这篇关于更改网址为.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文