Announcement

Collapse
No announcement yet.

mod rewrite question for static urls

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    mod rewrite question for static urls



    ------=_NextPart_000_0043_01C55BB3.C77D04E0
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    I have Merchant Optimizer, and I'm trying to set up the mod rewrite =
    rules so the merchant.mvc? product and category screen URLS rewrite to =
    the MO pages. I am having problems because some product codes and =
    categories have capital letters in them. When the URLs are rewritten, =
    it keeps the caps in tact, but all of the MO pages are built with =
    lowercase URLs.

    I tried the suggested rules that come with MO docs:

    RewriteEngine On
    RewriteCond %{QUERY_STRING} Category_Code=3D(.*)& [NC]
    RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
    RewriteCond %{QUERY_STRING} Category_Code=3D(.*)$ [NC]
    RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
    RewriteEngine On
    RewriteCond %{QUERY_STRING} Product_Code=3D(.*)& [NC]
    RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
    RewriteCond %{QUERY_STRING} Product_Code=3D(.*)$ [NC]
    RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]

    This rewrote my URLs like this: =
    http://storedomain.com/static/produc...&Product_Code=
    =3Dproductcode =20
    I have my Merchant2 files in my root directory, so maybe that's why. I =
    finally fixed that problem by adding a ? to my rules like so:

    RewriteEngine On
    RewriteCond %{QUERY_STRING} Category_Code=3D(.*)& [NC]
    RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
    RewriteCond %{QUERY_STRING} Category_Code=3D(.*)$ [NC]
    RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
    RewriteEngine On
    RewriteCond %{QUERY_STRING} Product_Code=3D(.*)& [NC]
    RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
    RewriteCond %{QUERY_STRING} Product_Code=3D(.*)$ [NC]
    RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]

    Now this rewrites my URLs correctly except for the case issue I =
    mentioned above:
    http://storedomain.com/merchant.mvc?...ory_Code=3Dabc
    is rewritten to:
    http://storedomain.com/static/abc.html

    However,
    http://storedomain.com/merchant.mvc?...ory_Code=3DABC
    is rewritten to=20
    http://storedomain.com/static/ABC.html
    which does not exist since MO converts it all to lowercase:
    http://storedomain.com/static/abc.html

    Can anyone suggest the proper syntax to rewrite the URLs to lowercase =
    only? I've been looking at a million rewrite examples, and haven't =
    found anything that works yet. =20

    Thanks,
    Amanda



    ------=_NextPart_000_0043_01C55BB3.C77D04E0--

    #2
    mod rewrite question for static urls



    Hi,
    I'm trying to expand the category tree on the storefront.
    I've got Miva 4.14 VC/CPT,SFT,PPT and OUI with DWP.
    Any toggles that I am missing to do this, or do I need to replace the Miva
    Generated category tree completely?
    Thanks,
    Art


    Art Shectman
    [email protected]


    Comment


      #3
      mod rewrite question for static urls



      oops my syntax error... try it just like the original rewriteCond
      but put the tolower: in front...
      like this...
      RewriteCond %{tolower:QUERY_STRING} Category_Code=(.*)& [NC]
      That is what I meant to type
      Kelly


      Kelly XR wrote:

      > THere is something called tolower...
      >
      > I'm not sure if you need to redirect to map of somewort.. or if it
      > will work...
      > but you might try it like this...I haven't tried it yet myself...
      >
      > RewriteCond ${lowercase:%{QUERY_STRING}}
      >
      > But if it works! LET US KNOW!!!
      >
      > Kelly
      >
      >
      >
      > Amanda P. - Miva List wrote:
      >
      >> I have Merchant Optimizer, and I'm trying to set up the mod rewrite
      >> rules so the merchant.mvc? product and category screen URLS rewrite
      >> to the MO pages. I am having problems because some product codes and
      >> categories have capital letters in them. When the URLs are
      >> rewritten, it keeps the caps in tact, but all of the MO pages are
      >> built with lowercase URLs.
      >>
      >> I tried the suggested rules that come with MO docs:
      >>
      >> RewriteEngine On
      >> RewriteCond %{QUERY_STRING} Category_Code=(.*)& [NC]
      >> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
      >> RewriteCond %{QUERY_STRING} Category_Code=(.*)$ [NC]
      >> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
      >> RewriteEngine On
      >> RewriteCond %{QUERY_STRING} Product_Code=(.*)& [NC]
      >> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
      >> RewriteCond %{QUERY_STRING} Product_Code=(.*)$ [NC]
      >> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
      >>
      >> This rewrote my URLs like this:
      >> http://storedomain.com/static/produc...de=productcode
      >> I have my Merchant2 files in my root directory, so maybe that's why.
      >> I finally fixed that problem by adding a ? to my rules like so:
      >>
      >> RewriteEngine On
      >> RewriteCond %{QUERY_STRING} Category_Code=(.*)& [NC]
      >> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
      >> RewriteCond %{QUERY_STRING} Category_Code=(.*)$ [NC]
      >> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
      >> RewriteEngine On
      >> RewriteCond %{QUERY_STRING} Product_Code=(.*)& [NC]
      >> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
      >> RewriteCond %{QUERY_STRING} Product_Code=(.*)$ [NC]
      >> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
      >>
      >> Now this rewrites my URLs correctly except for the case issue I
      >> mentioned above:
      >> http://storedomain.com/merchant.mvc?...egory_Code=abc
      >> is rewritten to:
      >> http://storedomain.com/static/abc.html
      >>
      >> However,
      >> http://storedomain.com/merchant.mvc?...egory_Code=ABC
      >> is rewritten to http://storedomain.com/static/ABC.html
      >> which does not exist since MO converts it all to lowercase:
      >> http://storedomain.com/static/abc.html
      >>
      >> Can anyone suggest the proper syntax to rewrite the URLs to lowercase
      >> only? I've been looking at a million rewrite examples, and haven't
      >> found anything that works yet.
      >> Thanks,
      >> Amanda
      >>
      >>
      >>
      >>
      >>
      >
      >

      Comment


        #4
        mod rewrite question for static urls



        Change mv to mvc! Your store is compiled and have a closer look at the faq
        file concerning the syntax you are using.

        BTW Why are you adding a after storecode (is your storecode really
        storecode?)??

        Andreas Toman
        PCINET, LLC
        Miva Development, Installation & Upgrade
        "E-commerce is the next step in the evolution ..."
        www.pcinet-llc.com


        -----Original Message-----
        From: [email protected]
        [mailto:[email protected]] On Behalf Of Visual Reality
        Sent: Tuesday, May 17, 2005 10:50 PM
        To: Miva Merchant Users
        Subject: [mru] Question about static search form.

        Hola. I am having a problem with my static search form.

        Here is the code I pasted in from the viking coders tutorial with a couple
        of slight mods:

        <form Style="display:inline" FORM METHOD = "post" ACTION
        ="<A HREF ="http://www.sermonvideos.com/Merchant2/merchant.mv?>">http://www.sermonvideos.com/Merchant2/merchant.mv?></A>
        <INPUT TYPE = "hidden" NAME = "Store_Code" VALUE = "storecode">
        <INPUT TYPE = "hidden" NAME = "Screen" VALUE = "SRCHM">
        <INPUT TYPE="hidden" NAME="Search_desc" VALUE="1">
        <INPUT TYPE="hidden" NAME="Search_name" VALUE="1">
        <INPUT TYPE="hidden" NAME="Search_keys" VALUE="1">
        <INPUT TYPE = "hidden" NAME = "BrokSearch_Have_List_Fields" VALUE="1">
        <INPUT TYPE="text" NAME="Search_search" SIZE="22" VALUE=""
        style="position:
        relative; top: 2; border-style: solid; border-width: 1">
        <input type="image" name="submit" align="middle"
        src="newestgobutton8.gif"
        width="29" height="19">
        </form>



        When I try to search for something, it gives me a "404 not found error"
        and this is what is shown in the URL Address bar:
        <A HREF ="http://www.sermonvideos.com/Merchant2/merchant.mv?><INPUT%20TYPE%20=">http://www.sermonvideos.com/Merchant2/merchant.mv?><INPUT%20TYPE%20=</A>

        Here is a link to the store for a try:

        <A HREF ="http://www.sermonvideos.com/Merchant2/merchant.mvc?">http://www.sermonvideos.com/Merchant2/merchant.mvc?</A>

        Thanks for any help!

        Craig L.



        Comment


          #5
          mod rewrite question for static urls



          I found out this will only work in httpd.conf not in the .htaccess file...
          So it will depend on how your host has your serving set up if you can
          have access to do it in your httpd.conf file or not.
          the httpd.conf affects a lot more than just your html directories...so
          if you are on a shared server, your host will probably not allow this.

          Kelly


          Kelly XR wrote:

          > oops my syntax error... try it just like the original rewriteCond
          > but put the tolower: in front...
          > like this...
          > RewriteCond %{tolower:QUERY_STRING} Category_Code=(.*)& [NC]
          > That is what I meant to type
          > Kelly
          >
          >
          > Kelly XR wrote:
          >
          >> THere is something called tolower...
          >>
          >> I'm not sure if you need to redirect to map of somewort.. or if it
          >> will work...
          >> but you might try it like this...I haven't tried it yet myself...
          >>
          >> RewriteCond ${lowercase:%{QUERY_STRING}}
          >>
          >> But if it works! LET US KNOW!!!
          >>
          >> Kelly
          >>
          >>
          >>
          >> Amanda P. - Miva List wrote:
          >>
          >>> I have Merchant Optimizer, and I'm trying to set up the mod rewrite
          >>> rules so the merchant.mvc? product and category screen URLS rewrite
          >>> to the MO pages. I am having problems because some product codes
          >>> and categories have capital letters in them. When the URLs are
          >>> rewritten, it keeps the caps in tact, but all of the MO pages are
          >>> built with lowercase URLs.
          >>>
          >>> I tried the suggested rules that come with MO docs:
          >>>
          >>> RewriteEngine On
          >>> RewriteCond %{QUERY_STRING} Category_Code=(.*)& [NC]
          >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
          >>> RewriteCond %{QUERY_STRING} Category_Code=(.*)$ [NC]
          >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
          >>> RewriteEngine On
          >>> RewriteCond %{QUERY_STRING} Product_Code=(.*)& [NC]
          >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
          >>> RewriteCond %{QUERY_STRING} Product_Code=(.*)$ [NC]
          >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
          >>>
          >>> This rewrote my URLs like this:
          >>> http://storedomain.com/static/produc...de=productcode
          >>> I have my Merchant2 files in my root directory, so maybe that's
          >>> why. I finally fixed that problem by adding a ? to my rules like so:
          >>>
          >>> RewriteEngine On
          >>> RewriteCond %{QUERY_STRING} Category_Code=(.*)& [NC]
          >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
          >>> RewriteCond %{QUERY_STRING} Category_Code=(.*)$ [NC]
          >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
          >>> RewriteEngine On
          >>> RewriteCond %{QUERY_STRING} Product_Code=(.*)& [NC]
          >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
          >>> RewriteCond %{QUERY_STRING} Product_Code=(.*)$ [NC]
          >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
          >>>
          >>> Now this rewrites my URLs correctly except for the case issue I
          >>> mentioned above:
          >>> http://storedomain.com/merchant.mvc?...egory_Code=abc
          >>> is rewritten to:
          >>> http://storedomain.com/static/abc.html
          >>>
          >>> However,
          >>> http://storedomain.com/merchant.mvc?...egory_Code=ABC
          >>> is rewritten to http://storedomain.com/static/ABC.html
          >>> which does not exist since MO converts it all to lowercase:
          >>> http://storedomain.com/static/abc.html
          >>>
          >>> Can anyone suggest the proper syntax to rewrite the URLs to
          >>> lowercase only? I've been looking at a million rewrite examples,
          >>> and haven't found anything that works yet. Thanks,
          >>> Amanda
          >>>
          >>>
          >>>
          >>>
          >>>
          >>
          >>

          Comment


            #6
            mod rewrite question for static urls



            ------=_NextPart_000_0164_01C55BD5.02D01480
            Content-Type: text/plain;
            charset="iso-8859-1"
            Content-Transfer-Encoding: quoted-printable

            Okay, I've done some googling on "tolower" and see it being used with a =
            "rewritemap" command... I'm not going to give up. :o)

            Amanda

            ----- Original Message -----=20
            From: Amanda P. - Miva List=20
            To: [email protected]=20
            Sent: Wednesday, May 18, 2005 5:56 PM
            Subject: Fw: [mru] mod rewrite question for static urls


            I don't have a host - I have a dedicated server, and I am using it in =
            the httpd.conf file. =20

            Amanda


            ----- Original Message -----=20
            From: Kelly XR=20
            To: Kelly XR=20
            Cc: Amanda P. - Miva List ; [email protected]=20
            Sent: Wednesday, May 18, 2005 5:07 PM
            Subject: Re: [mru] mod rewrite question for static urls


            I found out this will only work in httpd.conf not in the .htaccess =
            file...
            So it will depend on how your host has your serving set up if you =
            can=20
            have access to do it in your httpd.conf file or not.
            the httpd.conf affects a lot more than just your html =
            directories...so=20
            if you are on a shared server, your host will probably not allow =
            this.

            Kelly


            Kelly XR wrote:

            > oops my syntax error... try it just like the original rewriteCond
            > but put the tolower: in front...
            > like this...
            > RewriteCond %{tolower:QUERY_STRING} Category_Code=3D(.*)& [NC]
            > That is what I meant to type
            > Kelly
            >
            >
            > Kelly XR wrote:
            >
            >> THere is something called tolower...
            >>
            >> I'm not sure if you need to redirect to map of somewort.. or if =
            it=20
            >> will work...
            >> but you might try it like this...I haven't tried it yet myself...
            >>
            >> RewriteCond ${lowercase:%{QUERY_STRING}}
            >>
            >> But if it works! LET US KNOW!!!
            >>
            >> Kelly
            >>
            >>
            >>
            >> Amanda P. - Miva List wrote:
            >>
            >>> I have Merchant Optimizer, and I'm trying to set up the mod =
            rewrite=20
            >>> rules so the merchant.mvc? product and category screen URLS =
            rewrite=20
            >>> to the MO pages. I am having problems because some product =
            codes=20
            >>> and categories have capital letters in them. When the URLs are=20
            >>> rewritten, it keeps the caps in tact, but all of the MO pages =
            are=20
            >>> built with lowercase URLs.
            >>>
            >>> I tried the suggested rules that come with MO docs:
            >>>
            >>> RewriteEngine On
            >>> RewriteCond %{QUERY_STRING} Category_Code=3D(.*)& [NC]
            >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
            >>> RewriteCond %{QUERY_STRING} Category_Code=3D(.*)$ [NC]
            >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
            >>> RewriteEngine On
            >>> RewriteCond %{QUERY_STRING} Product_Code=3D(.*)& [NC]
            >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
            >>> RewriteCond %{QUERY_STRING} Product_Code=3D(.*)$ [NC]
            >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html [R,L]
            >>>
            >>> This rewrote my URLs like this: =20
            >>> =
            http://storedomain.com/static/produc...&Product_Code=
            =3Dproductcode =20
            >>> I have my Merchant2 files in my root directory, so maybe that's=20
            >>> why. I finally fixed that problem by adding a ? to my rules =
            like so:
            >>>
            >>> RewriteEngine On
            >>> RewriteCond %{QUERY_STRING} Category_Code=3D(.*)& [NC]
            >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
            >>> RewriteCond %{QUERY_STRING} Category_Code=3D(.*)$ [NC]
            >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
            >>> RewriteEngine On
            >>> RewriteCond %{QUERY_STRING} Product_Code=3D(.*)& [NC]
            >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
            >>> RewriteCond %{QUERY_STRING} Product_Code=3D(.*)$ [NC]
            >>> RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
            >>>
            >>> Now this rewrites my URLs correctly except for the case issue I=20
            >>> mentioned above:
            >>> =
            http://storedomain.com/merchant.mvc?...ory_Code=3Dabc
            >>> is rewritten to:
            >>> http://storedomain.com/static/abc.html
            >>>
            >>> However,
            >>> =
            http://storedomain.com/merchant.mvc?...ory_Code=3DABC
            >>> is rewritten to http://storedomain.com/static/ABC.html
            >>> which does not exist since MO converts it all to lowercase:
            >>> http://storedomain.com/static/abc.html
            >>>
            >>> Can anyone suggest the proper syntax to rewrite the URLs to=20
            >>> lowercase only? I've been looking at a million rewrite =
            examples,=20
            >>> and haven't found anything that works yet. Thanks,
            >>> Amanda
            >>>
            >>>
            >>>
            >>> =20
            >>>
            >>
            >>

            Comment

            Working...
            X