.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;
   }
}
相关推荐
Adorable老犀牛3 小时前
nginx_exporter:Prometheus 监控 Nginx 基础指标
运维·nginx·prometheus
码语智行5 小时前
常见nginx配置
运维·nginx
前端 贾公子5 小时前
小程序蓝牙打印探索与实践(下)
小程序·apache
DolphinScheduler社区7 小时前
Apache DolphinScheduler 3.4.2 正式发布!新增 Amazon EMR Serverless 插件,增强监控与补数据能力
大数据·云原生·serverless·apache·海豚调度·版本发版
前端 贾公子7 小时前
小程序蓝牙打印探索与实践(中)
apache
難釋懷7 小时前
Nginx使用sticky模块完成对Nginx的负载均衡
运维·nginx·负载均衡
SeaTunnel7 小时前
87 个 PR 迭代复盘|Apache SeaTunnel 5 月版本重点更新解读
大数据·数据库·开源·apache·seatunnel
DolphinScheduler社区7 小时前
实战演示 | 基于 Apache DolphinScheduler 与 Apache SeaTunnel 实现 MySQL 到 Doris 离线定时增量同步
数据库·mysql·开源·apache·海豚调度·大数据工作流调度
chéng ௹8 小时前
uniapp封装火山引擎 DataRangers 埋点 SDK
uni-app·apache·火山引擎
難釋懷8 小时前
Nginx水平扩展
运维·nginx