tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Bowen <kbo...@als.com>
Subject Re: address bar shows ip instead of domain name
Date Tue, 29 Jul 2008 16:34:22 GMT
In rule, map

/mydomain.com  to /mywebapp/welcome.action

in outbound-rule, map

/mywebapp/welcome.action to  /mydomain.com

Do that for welcome, register, and every other page.

Depending on the rules you need, you can make some use of regular  
expressions.

On Jul 29, 2008, at 10:25 AM, nilanthan wrote:

>
> Thanks. I have placed the files/codes in the right spots and when I do
> localhost:8080/mywebapp/rewrite-status I get the urlrewrite page.
>
> But what i need is when a user types in the browser  
> www.mydomain.com, it
> should go to http://00.00.00.00:8080/mywebapp/welcome.action but still
> display http://www.mydomain.com and when I click on a link, it  
> should take
> my to ex. http://00.00.00.00:8080/mywebapp/register.action but in the
> address bar show http://www.mydomain.com/register.action.
>
> Can you use this example for the urlrewrite and where to place the  
> codes?
>
> Thanks.
>
>
>
> Ken Bowen wrote:
>>
>> I don't know of any tutorial -- I found the documentation gave me
>> enough guidance.
>> It's really pretty straight-forward.
>> Drop a filter definition like this in your web.xml:
>>
>> <filter>
>>     <filter-name>UrlRewriteFilter</filter-name>
>>     <filter- 
>> class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</
>> filter-class>
>> <!--
>>     <init-param>
>>         <param-name>logLevel</param-name>
>>         <param-value>sysout:DEBUG</param-value>
>>     </init-param>
>> -->
>> </filter>
>>
>> <filter-mapping>
>>     <filter-name>UrlRewriteFilter</filter-name>
>>     <url-pattern>/*</url-pattern>
>>     <dispatcher>FORWARD</dispatcher>
>>     <dispatcher>REQUEST</dispatcher>
>>   </filter-mapping>
>>
>> Then add a file urlrewrite.xml in your WEB-INF containing mappings in
>> the following spirit:
>>
>> <rule>
>> 	<from>^/PrivacyPolicy$</from>
>>     	<to type="forward">/PrivacyPolicy.do</to>
>> </rule>
>> <outbound-rule>
>>     <from>^/PrivacyPolicy.do$</from>
>>     <to>/PrivacyPolicy</to>
>> </outbound-rule>
>>
>> The <outbound-rule> describes how to map something going from the
>> server to the browser,
>> and the (inbound) <rule> describes how to map what you mapped on
>> output (now coming back from the browser)
>>  back into what you  need to see on input.
>>
>> If you removed the comment symbols in the <filter> element, you get
>> detailed debugging ouptut.
>>
>> Hope this helps.
>> Ken
>>
>> On Jul 28, 2008, at 6:16 PM, nilanthan wrote:
>>
>>>
>>> Thanks. I have looked at that before but am a bit confused about the
>>> instructions. Is there a good tutorial for this urlrewrite?
>>>
>>>
>>> Ken Bowen wrote:
>>>>
>>>> Apply a rewrite filter (http://tuckey.org/urlrewrite/) to map the  
>>>> ip
>>>> expression to what you want.
>>>>
>>>> ken
>>>>
>>>> On Jul 28, 2008, at 5:36 PM, nilanthan wrote:
>>>>
>>>>>
>>>>> So what Can I do so that that domain goes to that address but  
>>>>> shows
>>>>> the
>>>>> domain in the address bar?
>>>>>
>>>>> Yuval Perlov wrote:
>>>>>>
>>>>>> Where ever you forward, that's what the address bar shows
>>>>>>
>>>>>>
>>>>>> On Jul 28, 2008, at 7:45 PM, nilanthan wrote:
>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>> I have a website hosted on netfirms. I have a domain,exmaple,
>>>>>>> mydomain.com
>>>>>>> and it forwards to an address http:/xx.xx.xxx.xx:8080/folder1/
>>>>>>> welcome.action
>>>>>>> where xx is the ip of the server.
>>>>>>>
>>>>>>> Im runningTomcat 5.5 alone without apache. The problem is that
>>>>>>> when
>>>>>>> a users
>>>>>>> goes to www.mydomain.com, it takes them to the site but in the
>>>>>>> address bar
>>>>>>> it shows http:/xx.xx.xxx.xx:8080/folder1/welcome.action  
>>>>>>> instead of
>>>>>>> mydomain.com.
>>>>>>>
>>>>>>> Is this an issue with DNS or something in Tomcat? I will have
>>>>>>> multiple sites
>>>>>>> running in the future so I cannot place the site folder in the
>>>>>>> ROOT
>>>>>>> directory.
>>>>>>>
>>>>>>> Thanks.
>>>>>>> -- 
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18694567.html
>>>>>>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> -- 
>>>>> View this message in context:
>>>>> http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18699993.html
>>>>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18700955.html
>>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18713361.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message