.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;
   }
}
相关推荐
fydw_7158 小时前
生产环境中安装和配置 Nginx 以部署 Flask 应用的详细指南
运维·nginx·flask
xzh8 小时前
问题:Nginx client_body_temp_path 文件会删除吗,删除时机?
nginx·架构
dessler10 小时前
代理服务器-LVS的3种模式与调度算法
运维·服务器·网络·算法·nginx·tomcat·lvs
2501_9111212314 小时前
Nginx+Tomcat 负载均衡群集
nginx·tomcat·负载均衡
小鱼小鱼.oO1 天前
阿里云服务器安装nginx并配置前端资源路径(前后端部署到一台服务器并成功访问)
服务器·nginx·阿里云
广东数字化转型1 天前
nginx怎么使用nginx-rtmp-module模块实现直播间功能
linux·运维·nginx
Yungoal1 天前
php & apache构建 Web 服务器
服务器·php·apache
�FENG1 天前
LVS、NGINX、HAPROXY的调度算法
nginx·lvs·haproxy·调度算法
哈哈哈哈哈哈哈哈哈...........2 天前
【Nginx】使用 Nginx+Lua 实现基于 IP 的访问频率限制
tcp/ip·nginx·lua
Adorable老犀牛2 天前
负载均衡将https请求转发后端http服务报错:The plain HTTP request was sent to HTTPS port
nginx·http·https·负载均衡