首页 > 系统相关 >thinkphp安装在子目录的nginx配置

thinkphp安装在子目录的nginx配置

时间:2023-01-11 18:03:12浏览次数:46  
标签:index rewrite URL htm 子目录 blog nginx thinkphp php


进行URL重写,将默认访问URL中的index.php?s=通过rewrite隐藏

location /blog/ {
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/blog/(.*)$ /blog/index.php?s=$1 last;
}
}

 

标签:index,rewrite,URL,htm,子目录,blog,nginx,thinkphp,php
From: https://blog.51cto.com/jing/6002494

相关文章

  • nginx反向代理,解决vue项目跨域问题
     nginx的配置:  把/api转到另一个域名下#PROXY-START/apilocation/api{expires12h;if($request_uri~*"(php|jsp|cgi|asp|aspx)"){expires0......
  • VUE项目的API项目的nginx配置
    #PROXY-START/apilocation/api{expires12h;if($request_uri~*"(php|jsp|cgi|asp|aspx)"){expi......
  • nginx配置
    #Formoreinformationonconfiguration,see#*OfficialEnglishDocumentation:http://nginx.org/en/docs/#*OfficialRussianDocumentation:http://ngin......
  • nginx 如何处理https 协议访问http 协议图片的问题
    1.先在后端转换成代理路径 2.然后再配置nginx,转换成http路径,实现访问    ......
  • Python import常见用法 & 父目录引用子目录py文件 & 子目录引用父目录py文件
    关于Python的import你要知道的种种常见用法引入模块import<模块名>,例如importos引入模块并起别名import<模块名>as<模块别名>,例如importnumpyasnp引入......
  • Nginx负载均衡(Centos7)
    需要实现的效果:centos服务器上安装nginx(监听80端口),另外安装两个tomcat,分别监听8080和8081当在浏览器中输入 http://192.168.17.129/edu/a.html 的时候,实现负载均衡,平......
  • nginx_keepalive
    客户端配置http{includemime.types;default_typeapplication/octet-stream;#log_formatmain'$remote_addr-$remote_user[$time_local]......
  • docker启动nginx,包含创建数据卷和端口映射
    首先先将nginx的配置文件进行获取,随便run一个nginx容器,将容器中的配置拷贝到linux中,代码如下: dockerrun-p80:80--namenginx-dnginx#没有镜像会自......
  • Nginx
    Nginx介绍Nginx是一款轻量级的we服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器。其特点是占有内存少,并发能力强,事实上nginx的并发能力在同类型的网页服务器中表......
  • thinkphp中或查询使用方法
    一:字符串条件查询 //直接实例化Model $user=M('user1'); var_dump($user->where('id=1ORage=55')->select())二:使用索引数组作为查询条件$u......