首頁  >  文章  >  後端開發  >  nginx下配置url重写!解决思路

nginx下配置url重写!解决思路

WBOY
WBOY原創
2016-06-13 10:17:18709瀏覽

nginx下配置url重写!
hostname/infor/index.php?q=ssq
hostname/ssq_index.html
我想把上面的url重写成下面的形式,谢谢大家!

------解决方案--------------------

RewriteEngine On
RewriteBase /
RewriteRule ^([0-9_a-z]+)_index.html$ infor/index.php?q=$1 [L,R=301]


仅供参考
------解决方案--------------------
RewriteEngine On
RewriteRule ^(.*)_index.html$ /infor/index.php?q=$1 [L]

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn