vidmarc Posted June 28, 2018 Share Posted June 28, 2018 Is this set in Cubecart, or in .htaccess? Link to comment Share on other sites More sharing options...
bsmither Posted June 28, 2018 Share Posted June 28, 2018 The "pattern" of parsing and creating friendly web addresses is in the SEO class (/classes/seo.class.php). There is also a similar pattern in .htaccess that parses for a URL that ends in .html. Link to comment Share on other sites More sharing options...
vidmarc Posted June 29, 2018 Author Share Posted June 29, 2018 Any suggestions as to what I need to do to remove .html and .php from urls? Link to comment Share on other sites More sharing options...
bsmither Posted June 29, 2018 Share Posted June 29, 2018 CubeCart uses only index.php and everything else is brought in using PHP's include function. So, it is (probably) possible to suppress the appearance of index.php in the URL because the web browser is commonly configured to execute it being the first in the list of default documents. First, if the .html part is going to disappear, then .htaccess needs to stop parsing for it. From: RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA] To: RewriteRule ^(.*)$ index.php?seo_path=$1 [L,QSA] But probably better to make it optional to catch obsolete occurances: RewriteRule ^(.*)(\.html?)?$ index.php?seo_path=$1 [L,QSA] (Check for the correctness of this format.) Next, in /classes/seo.class.php: Near line 45, from: private $_extension = '.html'; To: private $_extension = ''; Also in the same file: Find the function SEOable(). Near the beginning of the function, find three instances of str_replace() dealing with search.html. Replace search.html with just search. I haven't tried any of this. Link to comment Share on other sites More sharing options...
vidmarc Posted July 1, 2018 Author Share Posted July 1, 2018 I thought I should leave as is. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.