|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
Domain Remapping from .org to .comHi, when i type http://example.org/ or http://www.example.org/ then it has to redirect to http://www.example.com/ I written the below rule in urlrewrite.xml <rule> <name>Domain Remapping example.org</name> <condition name="host" operator="equal">example.org</condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to last="true" type="permanent-redirect">http://www.example.com/ $1</to> </rule> Could you please let me know whether the above rule will work for domain remapping. Thanks, Mahesh. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .comhi, Basically i need to redirect www and non-www url to www e.g.. http://www.example.org/ http://example.org/ To http://www.example.com/ Please advice me that this urlrewrite.xml rule is sufficient. <rule> <name>Domain Remapping example.org</name> <condition name="host" operator="equal">example.org</condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to last="true" type="permanent-redirect">http://www.example.com/ $1</to> </rule> Please help me out as soon as possible as i can't test it in local host this scenario. Regards, Mahesh On Oct 30, 9:37 am, mahesh <hariprasad.kanamarlap...@...> wrote: > Hi, > > when i type > > http://example.org/ or http://www.example.org/then it has to > redirect to http://www.example.com/ > > I written the below rule in urlrewrite.xml > > <rule> > <name>Domain Remapping example.org</name> > <condition name="host" operator="equal">example.org</condition> > <condition name="host" operator="notequal">^$</condition> > <from>^/(.*)</from> > <to last="true" type="permanent-redirect">http://www.example.com/ > $1</to> > </rule> > > Could you please let me know whether the above rule will work for > domain remapping. > > Thanks, > Mahesh. You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .comMultiple condition tags are "and'ed" while evaluating the rule. For your use-case, the underneath should suffice
<rule> <condition name="host" operator="equal" next="or">www.example.org</condition> <condition name="host" operator="equal">example.org</condition> <from>(.*)</from> <to last="true" type="permanent-redirect">http://www.example.com$1</to> </rule> Cheers Avlesh On Sat, Oct 31, 2009 at 12:43 AM, mahesh <hariprasad.kanamarlapudi@...> wrote:
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .comHi, Thanks AKR, but the below rules were correct or not to achieve the same(to redirect www and non-www url to www). <rule> <name>Domain Remapping www.example.com</name> <condition name="host" operator="equal">www.example.org</ condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to last="true" type="permanent-redirect">http://www.example.com/ $1</to> </rule> <rule> <name>Domain Remapping example.com</name> <condition name="host" operator="equal">example.org</condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to last="true" type="permanent-redirect">http://www.example.com/ $1</to> </rule> Please let me know ASAP. Regards, Mahesh On Oct 31, 11:00 pm, Avlesh Singh <avl...@...> wrote: > Multiple condition tags are "and'ed" while evaluating the rule. For your > use-case, the underneath should suffice > <rule> > <condition name="host" operator="equal" next="or">www.example.org > </condition> > <condition name="host" operator="equal">example.org</condition> > <from>(.*)</from> > <to last="true" type="permanent-redirect">http://www.example.com$1</to> > </rule> > > Cheers > Avlesh > > On Sat, Oct 31, 2009 at 12:43 AM, mahesh <hariprasad.kanamarlap...@... > > > wrote: > > > hi, > > > Basically i need to redirect www and non-www url to www > > e.g.. > >http://www.example.org/ > >http://example.org/ > > > To http://www.example.com/ > > > Please advice me that this urlrewrite.xml rule is sufficient. > > > <rule> > > <name>Domain Remapping example.org</name> > > <condition name="host" operator="equal">example.org</condition> > > <condition name="host" operator="notequal">^$</condition> > > <from>^/(.*)</from> > > <to last="true" type="permanent-redirect">http://www.example.com/ > > $1</to> > > </rule> > > > Please help me out as soon as possible as i can't test it in local > > host this scenario. > > Regards, > > Mahesh > > > On Oct 30, 9:37 am, mahesh <hariprasad.kanamarlap...@...> wrote: > > > Hi, > > > > when i type > > > >http://example.org/orhttp://www.example.org/thenit has to > > > redirect to http://www.example.com/ > > > > I written the below rule in urlrewrite.xml > > > > <rule> > > > <name>Domain Remapping example.org</name> > > > <condition name="host" operator="equal">example.org</condition> > > > <condition name="host" operator="notequal">^$</condition> > > > <from>^/(.*)</from> > > > <to last="true" type="permanent-redirect">http://www.example.com/ > > > $1</to> > > > </rule> > > > > Could you please let me know whether the above rule will work for > > > domain remapping. > > > > Thanks, > > > Mahesh. You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .comThanks AKRI tried really hard, but failed to understand the acronym! but the below rules were correct or not to achieve the same(to redirect www and non-www url to www).I don't think you would achieve what you want with these conditions. What makes you think that <condition name="host" operator="notequal">^$</condition> would NOT match anything under the sun? It is rule which essentially says "when the host is NOT equal to an empty string". Read the previous statement once more, and you would realize that it is true for all requests (because every request has a host header). As I earlier said, multiple <condition>'s are AND'ed with other, so in effect your rule only applies to requests from www.example.org domain. Did I make it clear? Please let me know ASAP.Your urgency is understood and respected. Queries on this mailing list don't go unanswered. Don't get impatient. Cheers Avlesh On Mon, Nov 2, 2009 at 3:13 PM, mahesh <hariprasad.kanamarlapudi@...> wrote:
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .comHi, Thank you so much for your quick reply. i run the same in localhost and it was working fine with the below condition <condition name="host" operator="notequal">^$</condition> when we enter some thing in the host and then checks the condition like http header!= " " and so the condition is always became TRUE. here is a log- [10/5/09 9:20:47:092 EDT] 0000002e WebApp A SRVE0180I: [Servlet.LOG]: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from" [10/5/09 9:20:47:092 EDT] 0000002e WebApp A SRVE0180I: [Servlet.LOG]: org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "localhost:9080" against localhost:9080 [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: [Servlet.LOG]: org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "localhost:9080" against ^$ [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: [Servlet.LOG]: org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: [Servlet.LOG]: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions match [10/5/09 9:20:47:123 EDT] 0000002e WebApp A SRVE0180I: [Servlet.LOG]: org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to be permanentely redirected to http://www.example.com/Applcationcontext/ [10/5/09 9:20:47:483 EDT] 0000002e WebApp A SRVE0180I: [Servlet.LOG]: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last --- what i understood is , it is not a harm if we have this condition . am i correct ? please let me know is it a harm or not if we have this condition in the rule. if so the below 2 rules are correct to achive(to redirect www and non-www url to www). because that condition is already existed in the application and we are just following. coming to improve, as you said this is not at all required because always true. correct ? You comments are so appreciated AKS. Regards, Mahesh. On Nov 2, 5:07 am, Avlesh Singh <avl...@...> wrote: > > Thanks AKR > > I tried really hard, but failed to understand the acronym! > > but the below rules were correct or not to achieve the same(to redirect www> and non-www url to www). > > <condition name="host" operator="equal">www.example.org</condition> > > <condition name="host" operator="notequal">^$</condition> > > ... > > I don't think you would achieve what you want with these conditions. What > makes you think that <condition name="host" > operator="notequal">^$</condition> would NOT match anything under the sun? > It is rule which essentially says "*when the host is NOT equal to an empty > string*". Read the previous statement once more, and you would realize that > *it is true for all requests *(because every request has a host header). As > I earlier said, multiple <condition>'s are AND'ed with other, so in effect > your rule only applies to requests fromwww.example.orgdomain. > Did I make it clear? > > Please let me know ASAP. > > Your urgency is understood and respected. Queries on this mailing list don't > go unanswered. Don't get impatient. > > Cheers > Avlesh > > On Mon, Nov 2, 2009 at 3:13 PM, mahesh > <hariprasad.kanamarlap...@...>wrote: > > > > > Hi, > > > Thanks AKR, but the below rules were correct or not to achieve the > > same(to redirect www and non-www url to www). > > > <rule> > > <name>Domain Remappingwww.example.com</name> > > <condition name="host" operator="equal">www.example.org</ > > condition> > > <condition name="host" operator="notequal">^$</condition> > > <from>^/(.*)</from> > > <to last="true" type="permanent-redirect">http://www.example.com/ > > $1</to> > > </rule> > > > <rule> > > <name>Domain Remapping example.com</name> > > <condition name="host" operator="equal">example.org</condition> > > <condition name="host" operator="notequal">^$</condition> > > <from>^/(.*)</from> > > <to last="true" type="permanent-redirect">http://www.example.com/ > > $1</to> > > </rule> > > > Please let me know ASAP. > > > Regards, > > Mahesh > > > On Oct 31, 11:00 pm, Avlesh Singh <avl...@...> wrote: > > > Multiple condition tags are "and'ed" while evaluating the rule. For your > > > use-case, the underneath should suffice > > > <rule> > > > <condition name="host" operator="equal" next="or">www.example.org > > > </condition> > > > <condition name="host" operator="equal">example.org</condition> > > > <from>(.*)</from> > > > <to last="true" type="permanent-redirect">http://www.example.com > > $1</to> > > > </rule> > > > > Cheers > > > Avlesh > > > > On Sat, Oct 31, 2009 at 12:43 AM, mahesh < > > hariprasad.kanamarlap...@... > > > > > wrote: > > > > > hi, > > > > > Basically i need to redirect www and non-www url to www > > > > e.g.. > > > >http://www.example.org/ > > > >http://example.org/ > > > > > To http://www.example.com/ > > > > > Please advice me that this urlrewrite.xml rule is sufficient. > > > > > <rule> > > > > <name>Domain Remapping example.org</name> > > > > <condition name="host" operator="equal">example.org</condition> > > > > <condition name="host" operator="notequal">^$</condition> > > > > <from>^/(.*)</from> > > > > <to last="true" type="permanent-redirect">http://www.example.com/ > > > > $1</to> > > > > </rule> > > > > > Please help me out as soon as possible as i can't test it in local > > > > host this scenario. > > > > Regards, > > > > Mahesh > > > > > On Oct 30, 9:37 am, mahesh <hariprasad.kanamarlap...@...> wrote: > > > > > Hi, > > > > > > when i type > > > > > >http://example.org/orhttp://www.example.org/thenithas to > > > > > redirect to http://www.example.com/ > > > > > > I written the below rule in urlrewrite.xml > > > > > > <rule> > > > > > <name>Domain Remapping example.org</name> > > > > > <condition name="host" operator="equal">example.org</condition> > > > > > <condition name="host" operator="notequal">^$</condition> > > > > > <from>^/(.*)</from> > > > > > <to last="true" type="permanent-redirect"> > >http://www.example.com/ > > > > > $1</to> > > > > > </rule> > > > > > > Could you please let me know whether the above rule will work for > > > > > domain remapping. > > > > > > Thanks, > > > > > Mahesh. You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .combecause that condition is already existed in the application and we are just following. coming to improve, as you said this is not at all required because always true. correct ?Yes, the condition (<condition name="host" operator="notequal">^$</condition>) is always true and hence not required. It should not matter whether you run your application in localhost or a named domain. Cheers Avlesh On Mon, Nov 2, 2009 at 4:19 PM, mahesh <hariprasad.kanamarlapudi@...> wrote:
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .comHi, Thanks a lot AKS. so will these rules suffice to archive redirect www and non-www url to www. <rule> <name>Domain Remapping www.example.com</name> <condition name="host" operator="equal">www.example.org</ condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to last="true" type="permanent-redirect">http://www.example.com/ $1</to> </rule> <rule> <name>Domain Remapping example.com</name> <condition name="host" operator="equal">example.org</condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to last="true" type="permanent-redirect">http://www.example.com/ $1</to> </rule> Please let me know. I think i am asking so many questions. sorry for that AKS as i can't test it production scenarios in the localhost for urlrewrite . Once again thanks for your comments. Regards, Mahesh. On Nov 2, 5:55 am, Avlesh Singh <avl...@...> wrote: > > because that condition is already existed in the application and we are > > just following. coming to improve, as you said this is not at all required > > because always true. correct ? > > Yes, the condition (<condition name="host" > operator="notequal">^$</condition>) is always true and hence not required. > It should not matter whether you run your application in localhost or a > named domain. > > Cheers > Avlesh > > On Mon, Nov 2, 2009 at 4:19 PM, mahesh > <hariprasad.kanamarlap...@...>wrote: > > > > > Hi, > > > Thank you so much for your quick reply. > > > i run the same in localhost and it was working fine with the below > > condition > > > <condition name="host" operator="notequal">^$</condition> > > > when we enter some thing in the host and then checks the condition > > like > > http header!= " " and so the condition is always became TRUE. > > > here is a log- > > > [10/5/09 9:20:47:092 EDT] 0000002e WebApp A SRVE0180I: > > [Servlet.LOG]: > > org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from" > > [10/5/09 9:20:47:092 EDT] 0000002e WebApp A SRVE0180I: > > [Servlet.LOG]: > > org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating > > "localhost:9080" against localhost:9080 > > [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: > > [Servlet.LOG]: > > org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating > > "localhost:9080" against ^$ > > [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: > > [Servlet.LOG]: > > org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator > > in use > > [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: > > [Servlet.LOG]: > > org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions match > > [10/5/09 9:20:47:123 EDT] 0000002e WebApp A SRVE0180I: > > [Servlet.LOG]: > > org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to > > be permanentely redirected tohttp://www.example.com/Applcationcontext/ > > [10/5/09 <http://www.example.com/Applcationcontext/%0A%5B10/5/09>9:20:47:483 EDT] 0000002e WebApp A SRVE0180I: > > [Servlet.LOG]: > > org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last > > > --- > > what i understood is , it is not a harm if we have this condition . > > am i correct ? > > please let me know is it a harm or not if we have this condition in > > the rule. if so the below 2 rules are correct to achive(to redirect > > www > > and non-www url to www). > > > because that condition is already existed in the application and we > > are just following. coming to improve, as you said this is not at all > > required because always true. correct ? > > > You comments are so appreciated AKS. > > > Regards, > > Mahesh. > > > On Nov 2, 5:07 am, Avlesh Singh <avl...@...> wrote: > > > > Thanks AKR > > > > I tried really hard, but failed to understand the acronym! > > > > but the below rules were correct or not to achieve the same(to redirect > > www> and non-www url to www). > > > > <condition name="host" operator="equal">www.example.org</condition> > > > > <condition name="host" operator="notequal">^$</condition> > > > > ... > > > > I don't think you would achieve what you want with these conditions. What > > > makes you think that <condition name="host" > > > operator="notequal">^$</condition> would NOT match anything under the > > sun? > > > It is rule which essentially says "*when the host is NOT equal to an > > empty > > > string*". Read the previous statement once more, and you would realize > > that > > > *it is true for all requests *(because every request has a host header). > > As > > > I earlier said, multiple <condition>'s are AND'ed with other, so in > > effect > > > your rule only applies to requests fromwww.example.orgdomain. > > > Did I make it clear? > > > > Please let me know ASAP. > > > > Your urgency is understood and respected. Queries on this mailing list > > don't > > > go unanswered. Don't get impatient. > > > > Cheers > > > Avlesh > > > > On Mon, Nov 2, 2009 at 3:13 PM, mahesh > > > <hariprasad.kanamarlap...@...>wrote: > > > > > Hi, > > > > > Thanks AKR, but the below rules were correct or not to achieve the > > > > same(to redirect www and non-www url to www). > > > > > <rule> > > > > <name>Domain Remappingwww.example.com</name> > > > > <condition name="host" operator="equal">www.example.org</ > > > > condition> > > > > <condition name="host" operator="notequal">^$</condition> > > > > <from>^/(.*)</from> > > > > <to last="true" type="permanent-redirect">http://www.example.com/ > > > > $1</to> > > > > </rule> > > > > > <rule> > > > > <name>Domain Remapping example.com</name> > > > > <condition name="host" operator="equal">example.org</condition> > > > > <condition name="host" operator="notequal">^$</condition> > > > > <from>^/(.*)</from> > > > > <to last="true" type="permanent-redirect">http://www.example.com/ > > > > $1</to> > > > > </rule> > > > > > Please let me know ASAP. > > > > > Regards, > > > > Mahesh > > > > > On Oct 31, 11:00 pm, Avlesh Singh <avl...@...> wrote: > > > > > Multiple condition tags are "and'ed" while evaluating the rule. For > > your > > > > > use-case, the underneath should suffice > > > > > <rule> > > > > > <condition name="host" operator="equal" next="or">www.example.org > > > > > </condition> > > > > > <condition name="host" operator="equal">example.org</condition> > > > > > <from>(.*)</from> > > > > > <to last="true" type="permanent-redirect">http://www.example.com > > > > $1</to> > > > > > </rule> > > > > > > Cheers > > > > > Avlesh > > > > > > On Sat, Oct 31, 2009 at 12:43 AM, mahesh < > > > > hariprasad.kanamarlap...@... > > > > > > > wrote: > > > > > > > hi, > > > > > > > Basically i need to redirect www and non-www url to www > > > > > > e.g.. > > > > > >http://www.example.org/ > > > > > >http://example.org/ > > > > > > > To http://www.example.com/ > > > > > > > Please advice me that this urlrewrite.xml rule is sufficient. > > > > > > > <rule> > > > > > > <name>Domain Remapping example.org</name> > > > > > > <condition name="host" operator="equal">example.org > > </condition> > > > > > > <condition name="host" operator="notequal">^$</condition> > > > > > > <from>^/(.*)</from> > > > > > > <to last="true" type="permanent-redirect"> > >http://www.example.com/ > > > > > > $1</to> > > > > > > </rule> > > > > > > > Please help me out as soon as possible as i can't test it in local > > > > > > host this scenario. > > > > > > Regards, > > > > > > Mahesh > > > > > > > On Oct 30, 9:37 am, mahesh <hariprasad.kanamarlap...@...> > > wrote: > > > > > > > Hi, > > > > > > > > when i type > > > > > > > >http://example.org/orhttp://www.example.org/thenithasto > > > > > > > redirect to http://www.example.com/ > > > > > > > > I written the below rule in urlrewrite.xml > > > > > > > > <rule> > > > > > > > <name>Domain Remapping example.org</name> > > > > > > > <condition name="host" operator="equal">example.org > > </condition> > > > > > > > <condition name="host" operator="notequal">^$</condition> > > > > > > > <from>^/(.*)</from> > > > > > > > <to last="true" type="permanent-redirect"> > > > >http://www.example.com/ > > > > > > > $1</to> > > > > > > > </rule> > > > > > > > > Could you please let me know whether the above rule will work > > for > > > > > > > domain remapping. > > > > > > > > Thanks, > > > > > > > Mahesh. You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .comso will these rules suffice to archive redirect www and non-www url to www. <rule> To keep the answer simple - YES. These rules would work without glitches for you.
But, why don't you consider the one that I sent in my first response. It is a lot more cleaner and accurate. I am pasting it once more for your reference - <rule> <condition name="host" operator="equal" next="or">www.example.org</condition> <condition name="host" operator="equal">example.org</condition> <from>(.*)</from> <to last="true" type="permanent-redirect">http://www.example.com$1</to> </rule> Cheers Avlesh On Mon, Nov 2, 2009 at 4:41 PM, mahesh <hariprasad.kanamarlapudi@...> wrote:
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Domain Remapping from .org to .comHi, Yes that is TRUE. what ever you proposed solution is the clean and accurate but that is an existing code and we will take that this is an improvement. Thanks AKS !!! Regards, Mahesh. On Nov 2, 6:29 am, Avlesh Singh <avl...@...> wrote: > > so will these rules suffice to archive redirect www and non-www url to > > www. > > <rule> > > > <name>Domain Remappingwww.example.com</name> > > <condition name="host" operator="equal">www.example.org</condition> > > <condition name="host" operator="notequal">^$</condition> > > <from>^/(.*)</from> > > <to last="true" type="permanent-redirect">http://www.example.com/ > > $1</to> > > </rule> > > > <rule> > > <name>Domain Remapping example.com</name> > > <condition name="host" operator="equal">example.org</condition> > > <condition name="host" operator="notequal">^$</condition> > > <from>^/(.*)</from> > > <to last="true" type="permanent-redirect">http://www.example.com/ > > $1</to> > > </rule> > > To keep the answer simple - YES. These rules would work without glitches for > you. > > But, why don't you consider the one that I sent in my first response. It is > a lot more cleaner and accurate. I am pasting it once more for your > reference - > <rule> > <condition name="host" operator="equal" next="or">www.example.org > </condition> > <condition name="host" operator="equal">example.org</condition> > <from>(.*)</from> > <to last="true" type="permanent-redirect">http://www.example.com$1</to> > </rule> > > Cheers > Avlesh > > On Mon, Nov 2, 2009 at 4:41 PM, mahesh > <hariprasad.kanamarlap...@...>wrote: > > > > > Hi, > > > Thanks a lot AKS. > > > so will these rules suffice to archive redirect www and non-www url to > > www. > > > <rule> > > <name>Domain Remappingwww.example.com</name> > > <condition name="host" operator="equal">www.example.org</ > > condition> > > <condition name="host" operator="notequal">^$</condition> > > <from>^/(.*)</from> > > <to last="true" type="permanent-redirect">http://www.example.com/ > > $1</to> > > </rule> > > > <rule> > > <name>Domain Remapping example.com</name> > > <condition name="host" operator="equal">example.org</condition> > > <condition name="host" operator="notequal">^$</condition> > > <from>^/(.*)</from> > > <to last="true" type="permanent-redirect">http://www.example.com/ > > $1</to> > > </rule> > > > Please let me know. I think i am asking so many questions. sorry for > > that AKS as i can't test it production scenarios in the localhost for > > urlrewrite . Once again thanks for your comments. > > > Regards, > > Mahesh. > > > On Nov 2, 5:55 am, Avlesh Singh <avl...@...> wrote: > > > > because that condition is already existed in the application and we are > > > > just following. coming to improve, as you said this is not at all > > required > > > > because always true. correct ? > > > > Yes, the condition (<condition name="host" > > > operator="notequal">^$</condition>) is always true and hence not > > required. > > > It should not matter whether you run your application in localhost or a > > > named domain. > > > > Cheers > > > Avlesh > > > > On Mon, Nov 2, 2009 at 4:19 PM, mahesh > > > <hariprasad.kanamarlap...@...>wrote: > > > > > Hi, > > > > > Thank you so much for your quick reply. > > > > > i run the same in localhost and it was working fine with the below > > > > condition > > > > > <condition name="host" operator="notequal">^$</condition> > > > > > when we enter some thing in the host and then checks the condition > > > > like > > > > http header!= " " and so the condition is always became TRUE. > > > > > here is a log- > > > > > [10/5/09 9:20:47:092 EDT] 0000002e WebApp A SRVE0180I: > > > > [Servlet.LOG]: > > > > org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from" > > > > [10/5/09 9:20:47:092 EDT] 0000002e WebApp A SRVE0180I: > > > > [Servlet.LOG]: > > > > org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating > > > > "localhost:9080" against localhost:9080 > > > > [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: > > > > [Servlet.LOG]: > > > > org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating > > > > "localhost:9080" against ^$ > > > > [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: > > > > [Servlet.LOG]: > > > > org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator > > > > in use > > > > [10/5/09 9:20:47:108 EDT] 0000002e WebApp A SRVE0180I: > > > > [Servlet.LOG]: > > > > org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions match > > > > [10/5/09 9:20:47:123 EDT] 0000002e WebApp A SRVE0180I: > > > > [Servlet.LOG]: > > > > org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to > > > > be permanentely redirected tohttp://www.example.com/Applcationcontext/ > > > > [10/5/09 <http://www.example.com/Applcationcontext/%0A%5B10/5/09>9:20:47:483 > > EDT] 0000002e WebApp A SRVE0180I: > > > > [Servlet.LOG]: > > > > org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last > > > > > --- > > > > what i understood is , it is not a harm if we have this condition . > > > > am i correct ? > > > > please let me know is it a harm or not if we have this condition in > > > > the rule. if so the below 2 rules are correct to achive(to redirect > > > > www > > > > and non-www url to www). > > > > > because that condition is already existed in the application and we > > > > are just following. coming to improve, as you said this is not at all > > > > required because always true. correct ? > > > > > You comments are so appreciated AKS. > > > > > Regards, > > > > Mahesh. > > > > > On Nov 2, 5:07 am, Avlesh Singh <avl...@...> wrote: > > > > > > Thanks AKR > > > > > > I tried really hard, but failed to understand the acronym! > > > > > > but the below rules were correct or not to achieve the same(to > > redirect > > > > www> and non-www url to www). > > > > > > <condition name="host" operator="equal">www.example.org > > </condition> > > > > > > <condition name="host" operator="notequal">^$</condition> > > > > > > ... > > > > > > I don't think you would achieve what you want with these conditions. > > What > > > > > makes you think that <condition name="host" > > > > > operator="notequal">^$</condition> would NOT match anything under the > > > > sun? > > > > > It is rule which essentially says "*when the host is NOT equal to an > > > > empty > > > > > string*". Read the previous statement once more, and you would > > realize > > > > that > > > > > *it is true for all requests *(because every request has a host > > header). > > > > As > > > > > I earlier said, multiple <condition>'s are AND'ed with other, so in > > > > effect > > > > > your rule only applies to requests fromwww.example.orgdomain. > > > > > Did I make it clear? > > > > > > Please let me know ASAP. > > > > > > Your urgency is understood and respected. Queries on this mailing > > list > > > > don't > > > > > go unanswered. Don't get impatient. > > > > > > Cheers > > > > > Avlesh > > > > > > On Mon, Nov 2, 2009 at 3:13 PM, mahesh > > > > > <hariprasad.kanamarlap...@...>wrote: > > > > > > > Hi, > > > > > > > Thanks AKR, but the below rules were correct or not to achieve the > > > > > > same(to redirect www and non-www url to www). > > > > > > > <rule> > > > > > > <name>Domain Remappingwww.example.com</name> > > > > > > <condition name="host" operator="equal">www.example.org</ > > > > > > condition> > > > > > > <condition name="host" operator="notequal">^$</condition> > > > > > > <from>^/(.*)</from> > > > > > > <to last="true" type="permanent-redirect"> > >http://www.example.com/ > > > > > > $1</to> > > > > > > </rule> > > > > > > > <rule> > > > > > > <name>Domain Remapping example.com</name> > > > > > > <condition name="host" operator="equal">example.org > > </condition> > > > > > > <condition name="host" operator="notequal">^$</condition> > > > > > > <from>^/(.*)</from> > > > > > > <to last="true" type="permanent-redirect"> > >http://www.example.com/ > > > > > > $1</to> > > > > > > </rule> > > > > > > > Please let me know ASAP. > > > > > > > Regards, > > > > > > Mahesh > > > > > > > On Oct 31, 11:00 pm, Avlesh Singh <avl...@...> wrote: > > > > > > > Multiple condition tags are "and'ed" while evaluating the rule. > > For > > > > your > > > > > > > use-case, the underneath should suffice > > > > > > > <rule> > > > > > > > <condition name="host" operator="equal" next="or"> > >www.example.org > > > > > > > </condition> > > > > > > > <condition name="host" operator="equal">example.org > > </condition> > > > > > > > <from>(.*)</from> > > > > > > > <to last="true" type="permanent-redirect"> > >http://www.example.com > > > > > > $1</to> > > > > > > > </rule> > > > > > > > > Cheers > > > > > > > Avlesh > > > > > > > > On Sat, Oct 31, 2009 at 12:43 AM, mahesh < > > > > > > hariprasad.kanamarlap...@... > > > > > > > > > wrote: > > > > > > > > > hi, > > > > > > > > > Basically i need to redirect www and non-www url to www > > > > > > > > e.g.. > > > > > > > >http://www.example.org/ > > > > > > > >http://example.org/ > > > > > > > > > To http://www.example.com/ > > > > > > > > > Please advice me that this urlrewrite.xml rule is sufficient. > > > > > > > > > <rule> > > > > > > > > <name>Domain Remapping example.org</name> > > > > > > > > <condition name="host" operator="equal">example.org > > > > </condition> > > > > > > > > <condition name="host" operator="notequal">^$</condition> > > > > > > > > <from>^/(.*)</from> > > > > > > > > <to last="true" type="permanent-redirect"> > > > >http://www.example.com/ > > > > > > > > $1</to> > > > > > > > > </rule> > > > > > > > > > Please help me out as soon as possible as i can't test it in > > local > > > > > > > > host this scenario. > > > > > > > > Regards, > > > > > > > > Mahesh > > > > > > > > > On Oct 30, 9:37 am, mahesh <hariprasad.kanamarlap...@... > > > > > wrote: > > > > > > > > > Hi, > > > > > > > > > > when i type > > > > > > > > > >http://example.org/orhttp://www.example.org/thenithasto > > > > > > > > > redirect to http://www.example.com/ > > > > > > > > > > I written the below rule in urlrewrite.xml > > ... > > read more » You received this message because you are subscribed to the Google Groups "UrlRewrite" group. To post to this group, send email to urlrewrite@... To unsubscribe from this group, send email to urlrewrite+unsubscribe@... For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |