tomact rewrite

简介: **配置rewirite** *1.1加载rewirite模块 Rewrite Valve can be enabled on Tomcat globally by adding org.apache.

**配置rewirite
**

1.1加载rewirite模块

Rewrite Valve can be enabled on Tomcat globally by adding org.apache.catalina.valves.rewrite.RewriteValve to $catalina_home/conf/context.xml (This context.xml is automatically loaded for every application in the Tomcat)

新添加字段

添加后的context.xml

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <!-- Default set of monitored resources. If one of these changes, the    -->
    <!-- web application will be reloaded.                                   -->
    <Valve className="org.apache.catalina.valves.rewrite.RewriteValve"/>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->
</Context>

1.2配置rewrite.config文件

rewrite.config file will be read globally (on all contexts/applications) if it's created in $catalina_home/webapps/ROOT/WEB-INF or per-app if created in e.g. $catalina_home/webapps/applicationOne/WEB-INF
rewrite.config 文件如果配置在context中则为全局,若配置在站点的WEB-INF文件夹下则为局部

配置文件内容如下

参考链接link

目录
相关文章
如何用限制立方样条(RCS)做生存分析?
如何用限制立方样条(RCS)做生存分析?
1760 0
如何用限制立方样条(RCS)做生存分析?
|
缓存 Kubernetes Docker
kubernetes 部署工具:sealos(2)
kubernetes 部署工具:sealos(2)
kubernetes 部署工具:sealos(2)
|
缓存 PHP
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection
2051 0
|
Java Apache Maven
HttpClientConnectionManager哪个版本里有?
【8月更文挑战第25天】HttpClientConnectionManager哪个版本里有?
887 2
|
缓存 Shell 网络安全
将应用程序打包成Docker镜像时可能遇到哪些问题?
将应用程序打包成Docker镜像时可能遇到哪些问题?
1355 77
|
前端开发 JavaScript API
前端大佬都在用的usePagination究竟有多强?
usePagination 是 alovajs 提供的一款强大的分页请求工具,专为简化分页场景而生。它能自动管理分页数据、支持预加载、追加模式以及丰富的列表操作函数,极大提升开发效率与用户体验。作为下一代请求工具,alovajs 不仅涵盖 15+ 请求策略,还通过状态化数据和特定事件减少代码量。无论是下拉加载还是翻页优化,usePagination 都能轻松应对。如果你正在寻找高效的分页解决方案,不妨试试这个贴心的工具!
|
人工智能 前端开发 JavaScript
智能编码在前端研发的创新应用
在前端开发领域,智能编码技术正引领一场变革,通过大模型的强大能力将自然语言需求直接转化为高效、可靠的代码实现。
808 10
|
Java API Apache
如何在Java中实现PDF生成
如何在Java中实现PDF生成
|
安全 测试技术 API
一图看懂API测试9种方法
一图看懂API测试九种方法:冒烟测试验证基本功能,功能测试确保符合规格,集成测试检查组件协同工作,回归测试防止新变更引入问题,负载测试评估性能稳定性,压力测试挑战极限负载,安全测试发现并修复漏洞,用户界面测试确保UI与API协调,模糊测试提升异常数据处理鲁棒性。
|
SQL 安全 数据库连接
【Qt运行流程详解】从启动到事件循环的深入解读
【Qt运行流程详解】从启动到事件循环的深入解读
1948 3

热门文章

最新文章