nginx下配置url重写!

末世剩人 2012-04-16 02:37:51
hostname/infor/index.php?q=ssq
hostname/ssq_index.html
我想把上面的url重写成下面的形式,谢谢大家!
...全文
315 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
coder 2012-04-16
  • 打赏
  • 举报
回复
RewriteEngine On
RewriteRule ^(.*)_index.html$ /infor/index.php?q=$1 [L]
末世剩人 2012-04-16
  • 打赏
  • 举报
回复
我在本地APACHE服务器试了,不行!这还不是nginx下的
hezi_jl 2012-04-16
  • 打赏
  • 举报
回复
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^([0-9_a-z]+)_index.html$ infor/index.php?q=$1 [L,R=301]
</IfModule>

仅供参考

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧