.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;
   }
}
相关推荐
Avan_菜菜9 天前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
ping某13 天前
为什么 Nginx 明明监听了 80,转发后端时却用了 4xxxx 端口?
后端·nginx
難釋懷15 天前
Nginx反向代理中的容错机制
运维·nginx
bloglin9999915 天前
Nginx高危漏洞CVE-2021-23017及配置样例
运维·nginx
进阶的小名15 天前
Spring Boot SSE + Nginx 配置:解决 EventSource 不实时返回、连接超时、流式响应被缓冲问题
spring boot·后端·nginx
小小龙学IT15 天前
Apache Airflow 2.x 深度指南:用 Python 编排一切的现代化工作流引擎
开发语言·python·apache
難釋懷15 天前
Nginx获取客户端真实IP
服务器·前端·nginx
Shepherd061915 天前
【IT 运维】Apache 使用 mod_remoteip 恢复 Cloudflare 后的真实访客 IP
运维·tcp/ip·apache
qq_谁赞成_谁反对15 天前
甲方IT的成长之路--nginx实战--2604
服务器·数据库·nginx
图灵追慕者15 天前
Nginx安裝以及配置顯示本地服務器文件夾
运维·nginx