Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default base href and canonicalLink have extra directory in urls...

    The html_header.php of my site says this:

    PHP Code:
    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER DIR_WS_HTTPS_CATALOG HTTP_SERVER DIR_WS_CATALOG ); ?>" />
    <?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
    <link rel="canonical" href="<?php echo $canonicalLink?>" />
    <?php ?>
    Which outputs this into the pages:

    Code:
    <base href="http://opalessenceshop.com/opalessenceshop/" />
    <link rel="canonical" href="http://opalessenceshop.com/opalessenceshop/index.php?main_page=shopping_cart" />
    Those extra /opalessenceshop/ directories should not be there. the correct urls are

    Code:
    <base href="http://opalessenceshop.com/" />
    <link rel="canonical" href="http://opalessenceshop.com/index.php?main_page=shopping_cart" />
    I'm not sure exactly how to edit the html_header.php file to correct this... help?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: base href and canonicalLink adding extra directory to urls...

    That's because you've edited your /includes/configure.php file and stuffed '/opalessenceshop/' into your DIR_WS_CATALOG when it should just be '/'.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: base href and canonicalLink adding extra directory to urls...

    Hmm.. I'm not entirely convinced that that isn't something the installer put in there during the reinstall I did, since I can't see why I would do that... but I changed them in the configure.php files (both of them) and it is still showing up. Do I need to go into the database to change it?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: base href and canonicalLink adding extra directory to urls...

    No. It's ONLY taken from the settings in your configure.php file.
    And the only reason the installer would put the extra foldername in there is if you told it to, or if the install happened in that folder originally, and maybe later you moved it without changing the file to match the new folder location.

    So, your edits probably aren't saving because the file is read-only. You can't save/upload changes to a file that's read-only. Make it writable first.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: base href and canonicalLink adding extra directory to urls...

    I had changed the file permissions to 755 but it was still showing up in the view source... so I used SSH to get in and edited the files directly on the server, and it worked! Whew. That was bugging me! Thanks for your help.

 

 

Similar Threads

  1. v154 Is <base href tag necessary?
    By s_mack in forum General Questions
    Replies: 20
    Last Post: 9 Nov 2015, 03:43 AM
  2. v138a ssl issue with base href and load balancer
    By peeceelee in forum Basic Configuration
    Replies: 7
    Last Post: 17 Nov 2012, 05:16 PM
  3. base href problem
    By cricles in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 20 Jul 2010, 06:34 AM
  4. secure and nonsecure items base href?
    By JJDoench in forum General Questions
    Replies: 20
    Last Post: 5 Jan 2010, 05:03 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