Announcement

Collapse
No announcement yet.

Fw: mod rewrite question for static urls

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

    Fw: mod rewrite question for static urls



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

    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 =

    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
    >>>
    >>
    >>
Working...
X