.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;
   }
}
相关推荐
Johny_Zhao1 小时前
K8S+nginx+MYSQL+TOMCAT高可用架构企业自建网站
linux·网络·mysql·nginx·网络安全·信息安全·tomcat·云计算·shell·yum源·系统运维·itsm
专注代码七年1 小时前
在Windows 境下,将Redis和Nginx注册为服务。
windows·redis·nginx
xixingzhe23 小时前
Nginx 配置多个监听端口
服务器·前端·nginx
Hello.Reader17 小时前
ngx_http_keyval_module动态键值管理
网络协议·nginx·http
又逢乱世1 天前
Ubuntu 安装 Nginx
运维·nginx
matrixlzp1 天前
Nginx yum 安装
nginx
matrixlzp1 天前
Nginx 使用 Keepalived 搭建 nginx 高可用
运维·nginx
Yang三少喜欢撸铁2 天前
【阿里云免费领取域名以及ssl证书,通过Nginx反向代理web服务】
nginx·阿里云·代理模式·ssl
Lw老王要学习2 天前
Linux架构篇、第三章_2_Linux服务器监控与NGINX优化
linux·运维·服务器·nginx·架构·云计算
Yang三少喜欢撸铁2 天前
【彻底卸载nginx并部署nginx1.22.1+ssl模块等】
运维·nginx·ssl