Announcement

Collapse
No announcement yet.

mod rewrite question for static urls - SOLVED!!!

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

    mod rewrite question for static urls - SOLVED!!!



    ------=_NextPart_000_0179_01C55BD8.40EDB170
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    I absolutely cannot believe this. I figured this out, somehow.

    Thanks, Kelly - I used your lead, read through some docs and examples, =
    and got lucky guessing on the syntax.=20

    This is what works (beautifully!):

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


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


    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
    >>>
    >>
    >>

    #2
    mod rewrite question for static urls - SOLVED!!!



    Amanda,
    Terrific! Did you do this in the httpd.conf or in your .htaccess file?
    I'm going to have to be doing this too very soon.
    Kelly

    Amanda P. - Miva List wrote:

    > I absolutely cannot believe this. I figured this out, somehow.
    >
    > Thanks, Kelly - I used your lead, read through some docs and examples,
    > and got lucky guessing on the syntax.
    >
    > This is what works (beautifully!):
    >
    > RewriteEngine On
    > rewritemap tolower int:tolower
    > RewriteCond ${tolower:%{QUERY_STRING}} Category_Code=(.*)& [NC]
    > RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
    > RewriteCond ${tolower:%{QUERY_STRING}} Category_Code=(.*)$ [NC]
    > RewriteRule ^(.*) http://storedomain.com/static/%
    > <http://storedomain.com/static/%1.html>1.html
    > <http://store.atozteacherstuff.com/download-now/%1.html>? [R,L]
    > RewriteEngine On
    > rewritemap tolower int:tolower
    > RewriteCond ${tolower:%{QUERY_STRING}} Product_Code=(.*)& [NC]
    > RewriteRule ^(.*) http://storedomain.com/static/%
    > <http://storedomain.com/static/%1.html>1.html
    > <http://store.atozteacherstuff.com/download-now/%1.html>? [R,L]
    > RewriteCond ${tolower:%{QUERY_STRING}} Product_Code=(.*)$ [NC]
    > RewriteRule ^(.*) http://storedomain.com/static/%
    > <http://storedomain.com/static/%1.html>1.html
    > <http://store.atozteacherstuff.com/download-now/%1.html>? [R,L]
    >
    >
    >
    > ----- Original Message -----
    > *From:* Amanda P. - Miva List <mailto:[email protected]>
    > *To:* Kelly XR <mailto:[email protected]> ;
    > [email protected]
    > <mailto:[email protected]>
    > *Sent:* Wednesday, May 18, 2005 6:11 PM
    > *Subject:* Re: [mru] mod rewrite question for static urls
    >
    > 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 -----
    > From: Amanda P. - Miva List
    > To: [email protected]
    > <mailto:[email protected]>
    > 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.
    >
    > Amanda
    >
    >
    > ----- Original Message -----
    > From: Kelly XR
    > To: Kelly XR
    > Cc: Amanda P. - Miva List ; [email protected]
    > <mailto:[email protected]>
    > 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
    > 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
    > <http://storedomain.com/static/productcode.html?Screen=PROD&Product_Code=productc ode>
    >
    > >>> 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
    > <http://storedomain.com/merchant.mvc?Screen=CTGY&Category_Code=abc>
    > >>> is rewritten to:
    > >>> http://storedomain.com/static/abc.html
    > >>>
    > >>> However,
    > >>>
    > http://storedomain.com/merchant.mvc?...egory_Code=ABC
    > <http://storedomain.com/merchant.mvc?Screen=CTGY&Category_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


      #3
      mod rewrite question for static urls - SOLVED!!!



      Amanda...
      One tip... you don't need the second set of
      rewrite engine on and rewritemap to lower int:tolower..
      You only need to turn on the rewrite engine once... once it is on, it's on.
      same with the map you only need to do that once.

      Kelly


      Amanda P. - Miva List wrote:

      >I absolutely cannot believe this. I figured this out, somehow.
      >
      >Thanks, Kelly - I used your lead, read through some docs and examples, and got lucky guessing on the syntax.
      >
      >This is what works (beautifully!):
      >
      >RewriteEngine On
      >rewritemap tolower int:tolower
      >RewriteCond ${tolower:%{QUERY_STRING}} Category_Code=(.*)& [NC]
      >RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
      >RewriteCond ${tolower:%{QUERY_STRING}} Category_Code=(.*)$ [NC]
      >RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
      >RewriteEngine On
      >rewritemap tolower int:tolower
      >RewriteCond ${tolower:%{QUERY_STRING}} Product_Code=(.*)& [NC]
      >RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
      >RewriteCond ${tolower:%{QUERY_STRING}} Product_Code=(.*)$ [NC]
      >RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
      >
      >
      > ----- Original Message -----
      > From: Amanda P. - Miva List
      > To: Kelly XR ; [email protected]
      > Sent: Wednesday, May 18, 2005 6:11 PM
      > Subject: Re: [mru] mod rewrite question for static urls
      >
      >
      > 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 -----
      > From: Amanda P. - Miva List
      > To: [email protected]
      > 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.
      >
      > Amanda
      >
      >
      > ----- Original Message -----
      > From: Kelly XR
      > To: Kelly XR
      > Cc: Amanda P. - Miva List ; [email protected]
      > 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
      > 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


        #4
        mod rewrite question for static urls - SOLVED!!!



        ------=_NextPart_000_0009_01C55C71.8D95ED00
        Content-Type: text/plain;
        charset="iso-8859-1"
        Content-Transfer-Encoding: quoted-printable

        Thanks for the tip, Kelly. I started out with the code that came with =
        the MO docs and it had both. I'll get rid of the redundant one.

        This is in the httpd.conf file. All the docs I saw about it said that =
        it would only work in the httpd.conf file, like you said yesterday.

        Amanda
        ----- Original Message -----=20
        From: Kelly XR=20
        To: Amanda P. - Miva List=20
        Cc: [email protected]=20
        Sent: Thursday, May 19, 2005 11:02 AM
        Subject: Re: [mru] mod rewrite question for static urls - SOLVED!!!


        Amanda...
        One tip... you don't need the second set of
        rewrite engine on and rewritemap to lower int:tolower..
        You only need to turn on the rewrite engine once... once it is on, =
        it's on.
        same with the map you only need to do that once.

        Kelly


        Amanda P. - Miva List wrote:

        >I absolutely cannot believe this. I figured this out, somehow.
        >
        >Thanks, Kelly - I used your lead, read through some docs and =
        examples, and got lucky guessing on the syntax.=20
        >
        >This is what works (beautifully!):
        >
        >RewriteEngine On
        >rewritemap tolower int:tolower=20
        >RewriteCond ${tolower:%{QUERY_STRING}} Category_Code=3D(.*)& [NC]
        >RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
        >RewriteCond ${tolower:%{QUERY_STRING}} Category_Code=3D(.*)$ [NC]
        >RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
        >RewriteEngine On
        >rewritemap tolower int:tolower=20
        >RewriteCond ${tolower:%{QUERY_STRING}} Product_Code=3D(.*)& [NC]
        >RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
        >RewriteCond ${tolower:%{QUERY_STRING}} Product_Code=3D(.*)$ [NC]
        >RewriteRule ^(.*) http://storedomain.com/static/%1.html? [R,L]
        >
        >
        > ----- Original Message -----=20
        > From: Amanda P. - Miva List=20
        > To: Kelly XR ; [email protected]=20
        > Sent: Wednesday, May 18, 2005 6:11 PM
        > Subject: Re: [mru] mod rewrite question for static urls
        >
        >
        > 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 =

        > >>> 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