Jump to content

What code process sets .html on links?


Dirty Butter

Recommended Posts

I've wracked my brain trying to get a test site with the latest 6.4.0 commit to work. All seems to be working except something has caused the .html to not show on any links. I assume this issue has something to do with the new re-direct code in this new version. But I can't find anything I have not done correctly.

@bsmither could you explain how the code adds the .html? Maybe that will help me trace my mistake.

Link to comment
Share on other sites

For CC629, in the SEO class, there is an attribute, private $_extension = '.html'. This attribute is used in the public function buildURL(), and also public function generatePath() where using it is an option.

For CC640, there is a new setting on Store Settings, Search Engines tab, SEO URL Extension, which probably needs to have a decision made, as "None" is recommended.

Also for CC640, there is quite a bit of new code to allow for not having an extension at all, such as the SEO attribute $_extension now defaults to an empty string, and buildURL() does not use it anymore.

Since the GitHub issue #1164 is still open, expect to consider it still broken.

Link to comment
Share on other sites

This code is still a bit experimental. Saying this my development store seems stable with these changes. Please delete the .htaccess file and allow it to be regenerated to make sure the rewrite code is good.

There is quite a bit of testing to be done still and I expect 6.4.0 will have a short beta period as there are some quite significant updates. 

Link to comment
Share on other sites

Thanks to both of you! I knew it was still not completed, but since you have had success with it Al I figured it was my mistake. The one thing that really concerns me with it is that my store is on a domain that has a wordpress site at the root which is using a redirect plugin. I fear they are competing. I will try deleting the htaccess file and report.

Deleting htaccess file and allowing CC to recreate did not solve it.

I tried disabling the Redirection plugin on the plushmemories.com WP install, but it did not solve the problem.

Link to comment
Share on other sites

I did just try choosing to have the .html in the admin setting and it worked properly this time. The hover on a product listing still does not show the extension, but clicking on the product now resolves to the correct link. I've tried that in the past unsuccessfully, so maybe letting htaccess create again solved it.

Comparing the old and new htaccess file - the new line does not have the html in it:

RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA]

 

Link to comment
Share on other sites

Another spot that seems to need tweaking - unless of course there are code edits I've made in the past that are messing this up for me.

With new commit set to no .html - hovering over a link shows no .html,

-------- NO THIS DOES NOT RESOLVE TO .HTML, ALTHOUGH SITEMAP SHOWS HTML-  but clicking resolves to XXX.html as it should. -------------

In testing with and without html, I realized clearing cache was not enough to get all the changes viewable and useable - it is also necessary to clear the existing seo url and allow CC to automatically populate that space again with or without html as desired. One weird thing to me is that the mewly created seo url in the product listing does not show unless I physically SAVE the product. But the sitemap created after deleting all old seo urls and empyting cache DOES show all the appropriate urls.

NONE of my fiddling, however, has made anything work properly for the Login/Register link.

BUT Login/Register has html hard coded in - 404's as the code is now. I tried just removing .html from the links on content.login.php and content.register.php, but that did not fix it.

I would be glad to have this converstaion on GitHub instead of here, but I could not find where to comment on this. Sorry.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...