Make a SEO friendly URL

View: New views
3 Messages — Rating Filter:   Alert me  

Make a SEO friendly URL

by Upul Iroshan Abayagunawardhana-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I want to create SEO friendly url in my project. Then I found
URLRewriteFilter library. I add the neccessary setting to my web.xml
file and in my urlrewrite.xml file i created this rule..

<outbound-rule>
        <from>^/world.jsp?country=([a-z]+)&city=([a-z]+)$</from>
        <to>/world/$1/$2</to>
    </outbound-rule>

it's from the urlrewritefilter manual.

in my jsp page i create the following line to create the link..

<a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc")
%>">nyc</a>

But it didn't change as manual says.. is there any other setting
should be made to make work this.

--~--~---------~--~----~------------~-------~--~----~
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: Make a SEO friendly URL

by Paul Tuckey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


try:
<a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc") %>">nyc</a>

On Wed, May 28, 2008 at 5:40 PM, Upul Iroshan Abayagunawardhana
<iroshan@...> wrote:

>
> I want to create SEO friendly url in my project. Then I found
> URLRewriteFilter library. I add the neccessary setting to my web.xml
> file and in my urlrewrite.xml file i created this rule..
>
> <outbound-rule>
>        <from>^/world.jsp?country=([a-z]+)&city=([a-z]+)$</from>
>        <to>/world/$1/$2</to>
>    </outbound-rule>
>
> it's from the urlrewritefilter manual.
>
> in my jsp page i create the following line to create the link..
>
> <a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc")
> %>">nyc</a>
>
> But it didn't change as manual says.. is there any other setting
> should be made to make work this.
>
> >
>



--
Cheers,
Paul.

--~--~---------~--~----~------------~-------~--~----~
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: Make a SEO friendly URL

by Upul Iroshan Abayagunawardhana-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thank you paul your reply.

But it's still the same. Any way i got some output with that. But
still have problems..

here is my rule:

        <rule>
                <from>^/hello/(.*)/(.*)/(.*)/(.*)$</from>
                <to>/hello.jsp?$1=$2&$3=$4</to>
        </rule>
        <outbound-rule>
                <from>^hello.jsp?(.*)=(.*)&(.*)=(.*)$</from>
                <to>hello/$1/$2/$3/$4</to>
        </outbound-rule>

then it's work almost fine.. but one thing goes out. that's it doesn't
remove the '?' from the url

http://localhost:8080/myapp/hello/?country/lanka/city/colombo

only redirect to the correct page when '?' removed.

it's like that. Any suggession. or please tell me where is the
problem.

On May 28, 12:40 pm, "Paul Tuckey" <p...@...> wrote:

> try:
> <a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc") %>">nyc</a>
>
> On Wed, May 28, 2008 at 5:40 PM, Upul Iroshan Abayagunawardhana
>
>
>
> <iros...@...> wrote:
>
> > I want to create SEO friendly url in my project. Then I found
> > URLRewriteFilter library. I add the neccessary setting to my web.xml
> > file and in my urlrewrite.xml file i created this rule..
>
> > <outbound-rule>
> >        <from>^/world.jsp?country=([a-z]+)&city=([a-z]+)$</from>
> >        <to>/world/$1/$2</to>
> >    </outbound-rule>
>
> > it's from the urlrewritefilter manual.
>
> > in my jsp page i create the following line to create the link..
>
> > <a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc")
> > %>">nyc</a>
>
> > But it didn't change as manual says.. is there any other setting
> > should be made to make work this.
>
> --
> Cheers,
> Paul.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price!