/ / urlrewritefilter tuckey конфигурация за tomcat 7.0.64 - tuckey-urlrewrite-filter

urlrewritefilter tuckey конфигурация за tomcat 7.0.64 - tuckey-urlrewrite-filter

Аз се опитвам да конфигурирам urlrewritefilter 4.0.3, но аз не съм сигурен да разбера инструкциите и да го настроя по правилния начин. Използвам apache-tomcat-7.0.64, инсталиран под /opt/apache-tomcat-7.0.64/ и със следната конфигурация:

Използване на CATALINA_BASE: /opt/apache-tomcat-7.0.64 Използване на CATALINA_HOME: /opt/apache-tomcat-7.0.64 Използване на CATALINA_TMPDIR: /opt/apache-tomcat-7.0.64/temp Използване на JRE_HOME: /opt/jdk1.7.0_80/jre Използване на CLASSPATH: /opt/apache-tomcat-7.0.64/bin/bootstrap.jar:/opt/apache-tomcat-7.0.64/bin/tomcat-juli.jar

Зададох конфигурацията по следния начин:

urlrewritefilter-4.0.3.jar  under folder /opt/apache-tomcat-7.0.64/lib
web.xml and urlrewrite.xml files under /opt/apache-tomcat-7.0.64/webapps/ROOT/WEB-INF
configuration for these files are:
web.xml content ini
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
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.
-->

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0"
metadata-complete="true">

<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>

<!-- set the amount of seconds the conf file will be checked for reload
can be a valid integer (0 denotes check every time,
empty/not set denotes no reload check) -->
<init-param>
<param-name>confReloadCheckInterval</param-name>
<param-value>0</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

</web-app>
web.xml content end
******************************
urlrewrite.xml content ini
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE urlrewrite
PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN"
"http://www.tuckey.org/res/dtds/urlrewrite3.0.dtd">

<!--
UrlRewriteFilter from http://tuckey.org/urlrewrite/ proyect
-->
<urlrewrite>
<rule>
<name>redirect</name>
<condition name="host" operator="notequal">^www.tucarne.com</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">http://www.tucarne.com/$1</to>
</rule>
</urlrewrite>

urlrewrite.xml content end

Тъй като аз и получаване от ръководството и често задавани въпроси уеб и urlrewrite файлове са определени в правилния път и с правилното containt, но тя не работи ". Аз не знам защо е грешно.

Можете ли да ми помогнете на този етап?

Благодаря предварително.

Отговори:

0 за отговор № 1

Обърнете внимание, че ROOT уеб приложението не обслужва други заявки за уеб приложения. Например ако разположите уеб приложението WEBAPP1, тогава URL [protocol]://[hostname]:[port]/WEBAPP1/somepage.html няма да бъде обслужвано от ROOT уеб приложение.

Тя ще бъде обслужвана от уеб приложението WEBAPP1.

Ако конфигурирате филтъра на Турция в ROOT уеб приложението, той ще обработва само заявки към уеб приложението ROOT (пътят на контекста е низ от нула, който е [protocol]://[hostname]:[port]/ или [protocol]://[hostname]:[port]/?somearg=value).