.htaccess配置重写url引擎

.htaccess 文件配置

Apache:

复制代码
<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Indexes -Multiviews
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
</IfModule>

Nginx:

复制代码
location ~* (runtime|application)/{
   return 403;
}
location / {
   if (!-e $request_filename){
      rewrite  ^(.*)$  /index.php?s=$1  last;   break;
   }
}
相关推荐
ZHOU西口3 小时前
微服务实战系列之玩转Docker(十五)
nginx·docker·微服务·云原生·swarm·docker swarm·dockerui
苹果醋37 小时前
react 路由 react-router/react-router-dom
运维·nginx
檀越剑指大厂13 小时前
开源多场景问答社区论坛Apache Answer本地部署并发布至公网使用
开源·apache
nvd1114 小时前
Java ETL - Apache Beam 简介
java·apache·etl
ps酷教程15 小时前
nginx进阶篇(二)
nginx
双普拉斯15 小时前
微信小程序点赞动画特效实现
nginx·微信小程序·notepad++
苏少朋15 小时前
Docker安装 ▎Docker详细讲解 ▎数据卷挂载 ▎Nginx安装理解
linux·nginx·docker·容器
比花花解语15 小时前
怎么使用nginx把80端口代理到想要的端口?
运维·nginx
ps酷教程1 天前
nginx基础篇(一)
nginx
爱吃龙利鱼1 天前
nginx实现https安全访问的详细配置过程
运维·nginx·安全·云原生·https