3 Replies Latest reply on Dec 20, 2007 8:05 AM by pmuir

    need help with url rewriting

    skanky78

      hi,

      i'm using the urlrewritefilter to pretty up my product links for a better google indexing (removing product parameter).

      example:

      .../product/snowboarda


      is transferred via url rewriting rule to

      .../product.seam?product=snowboarda


      rewriting rule
      <rule>
       <from>^/product/([a-zA-Z]+)$</from>
       <to>/product.seam?product=$1</to>
      </rule>
      



      but my problem ist that i've no idee at the momant how to rewrite outbound links in my facelets. i read the paragraph about outbound-rule in the in the manuel (http://tuckey.org/urlrewrite/manual/3.0/). now i'm wondering how i can use this together with s:link? what about form submits or redirects (action outcome null)? please help to sort things out :)

      possible rewriting outbound rule (?)
      <outbound-rule>
       <from>^/product.seam?product=([a-zA-Z]+)$</from>
       <to>/product/$1</to>
      </outbound-rule>
      


      any hints/ideas?

      cheers,
      sven

        • 1. Re: need help with url rewriting
          holmes.j

          I had a few problems with this. Managed to figure it out

           <outbound-rule match-type="wildcard">
           <from>/page/activity/details.faces?activityId=*</from>
           <to>/activity/$1</to>
           </outbound-rule>
          


          You'll probably want to substitute the .faces for .seam instead.

          • 2. Re: need help with url rewriting
            skanky78

            thank you for your reply :) but my problem ist that i don't know how to handle s:links and form submits. how do i rewrite these urls? i have already an outbound rule but it is'nt applied...

            sven

            • 3. Re: need help with url rewriting
              pmuir

              Outbound rules should be applied to any link JSF builds (urlrewrite hooks into the Servlet encoding engine). I've never done this personally though.