Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2010
    Posts
    50
    Plugin Contributions
    0

    Default Lowercase URLs and Currencies

    The website is http://lotusmoonjewellery.com which is set up with zc1.5.5d and Ceon-URI-Mapping-4.5.2.

    The .htaccess file in the root directory includes code to force URI to lowercase:

    Code:
    ### beginning of section  THIS SECTION TO FORCE URI TO LOWERCASE
    # AS PER simonholywell-force-lowercase-urls-rewrite-php AND stackoverflow questions 26032665
    RewriteBase /
    # force url to lowercase if upper case is found
    RewriteCond %{REQUEST_URI} [A-Z] [OR]
    RewriteCond %{QUERY_STRING} [A-Z]
    # ensure it is not a file on the drive first
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule (.*) rewrite-strtolower.php?rewrite-strtolower-url=$1 [QSA,L]
    ### end of section
    The problem occurs when we switch currencies, and we get a 404 error,
    "http://lotusmoonjewellery.com/?currency=EUR&main_page=index"
    with the comment,

    "Error 404 - Not Found
    The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance."

    This is expected of course, with the currency "EUR" being in uppercase.
    (in fact if we edit the uri to read "http://lotusmoonjewellery.com/?currency=eur&main_page=index" then the page is properly found, and with the correct currency).

    We're hoping someone can suggest a quick fix to this problem?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Lowercase URLs and Currencies

    That can't/shouldn't be the entire htaccess file otherwise where is the ceon associated code? (if posted please obscure your admin directory if present).

    Also, why force everything to lowercase instead of just ignoring the case? Seems like extra "work" and problems like the above.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Lowercase URLs and Currencies

    Quote Originally Posted by RedSpinnaker View Post
    We're hoping someone can suggest a quick fix to this problem?
    The quick fix is don't do it. :)

    Seriously though, do you have a business reason for doing this?

    Domain names are case insensitive, and the parameters that follow are generally case sensitive for good reason, so mussing with them is usually a bad idea.

    Just my 2cents

    Cheers
    RodG

  4. #4
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Lowercase URLs and Currencies

    Quote Originally Posted by RedSpinnaker View Post
    The website is http://lotusmoonjewellery.com which is set up with zc1.5.5d and Ceon-URI-Mapping-4.5.2.

    The .htaccess file in the root directory includes code to force URI to lowercase:

    Code:
    ### beginning of section  THIS SECTION TO FORCE URI TO LOWERCASE
    # AS PER simonholywell-force-lowercase-urls-rewrite-php AND stackoverflow questions 26032665
    RewriteBase /
    # force url to lowercase if upper case is found
    RewriteCond %{REQUEST_URI} [A-Z] [OR]
    RewriteCond %{QUERY_STRING} [A-Z]
    # ensure it is not a file on the drive first
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule (.*) rewrite-strtolower.php?rewrite-strtolower-url=$1 [QSA,L]
    ### end of section
    That is not quite what the stackover solution suggested and your .htaccess directives, as they are, will never work.

    Seems nobody tested the .htaccess change on the site.

    I tested using:
    http: //lotusmoonjewellery . com/sterling-Silver-agate-Ring-101501
    (spacing is intentional to prevent indexing of this post)

    and got the same 404 error. No upper case -> lower case rewriting at all.


    The stackoverflow suggestion is using just:

    Code:
    RewriteBase /
    
    # force url to lowercase if upper case is found
    RewriteCond %{REQUEST_URI} [A-Z]
    RewriteRule (.*) rewrite-strtolower.php?rewrite-strtolower-url=$1 [QSA,L]
    Which might work, depending upon your PHP code.

    I would also wonder "why" the need for this rewriting as it does seem to be useless code.
    Last edited by Website Rob; 15 Feb 2017 at 05:25 PM.

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Lowercase URLs and Currencies

    Quote Originally Posted by Website Rob View Post
    That is not quite what the stackover solution suggested and your .htaccess directives, as they are, will never work.

    Seems nobody tested the .htaccess change on the site.

    I tested using:
    http: //lotusmoonjewellery . com/sterling-Silver-agate-Ring-101501
    (spacing is intentional to prevent indexing of this post)

    and got the same 404 error. No upper case -> lower case rewriting at all.


    The stackoverflow suggestion is using just:

    Code:
    RewriteBase /
    
    # force url to lowercase if upper case is found
    RewriteCond %{REQUEST_URI} [A-Z]
    RewriteRule (.*) rewrite-strtolower.php?rewrite-strtolower-url=$1 [QSA,L]
    Which might work, depending upon your PHP code.

    I would also wonder "why" the need for this rewriting as it does seem to be useless code.
    About as useful as an outdoor refrigerator at the South Pole. I'd get rid of it. URL's are case insensitive.
    19 years a Zencart User

  6. #6
    Join Date
    Oct 2010
    Posts
    50
    Plugin Contributions
    0

    Default Re: Lowercase URLs and Currencies

    Quote Originally Posted by Website Rob View Post
    I tested using:
    http: //lotusmoonjewellery . com/sterling-Silver-agate-Ring-101501
    (spacing is intentional to prevent indexing of this post)
    and got the same 404 error. No upper case -> lower case rewriting at all.

    I would also wonder "why" the need for this rewriting
    Thanks for the quick replies which are much appreciated :)

    Actually our problem is resolved, the "quick fix" being to upload the file "rewrite-strtolower.php" referred to in the above, and which we had overlooked when we upgraded the site!

    Rob, the upper case -> lower case rewriting should now work, if you would like to recheck.

    As for the biz reason, it was simply that all the site URLs were previously written in "title" case and are now all lowercase.
    While the URLs may be case insensitive, someone needs to inform Google who were reporting every uri in duplicate
    Last edited by RedSpinnaker; 16 Feb 2017 at 01:54 AM.

 

 

Similar Threads

  1. Name disappears if all lowercase?
    By soyabeane in forum General Questions
    Replies: 3
    Last Post: 14 May 2009, 05:14 AM
  2. Languages and currencies
    By shocker in forum Addon Language Packs
    Replies: 1
    Last Post: 24 Oct 2008, 09:19 AM
  3. Paypal and currencies
    By phreakymonkey in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 4 Oct 2007, 09:20 AM
  4. CSS Button Text...Changes to lowercase
    By absoluteblock in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Jan 2007, 10:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR