windows服务器下iis8的伪静态转linux系统 后nginx伪静态前端显示404

A_鹏飞 2020-12-18 02:03:58

之前在windows服务器下iis8的伪静态写法,为什么现在换成了linux系统,nginx伪静态前端显示404

这个是iis8的伪静态
<rule name="fenlei">
<match url="^([_-~\w]+)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="/category.php?catid={R:1}" appendQueryString="false" />
</rule>
结果:http://www.xxx.com/xxxx/ 可以访问目标页面

linux 系统 nginx伪静态 前端显示404
location / {
rewrite "^([^\.]*)/([_-~\w])/\$" $1/category.php?catid=$2 last;
}

结果:http://www.xxx.com/xxxx/ 访问目标页面404

这个问题怎么解决啊?百度了两天也不能解决,只好来这里求助了


...全文
178 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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