Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 SEO Friendly Categories Not Working
Author « Topic »  

on_edge
Advanced Member

USA
275 Posts

Pre-sales questions only
(More Details...)

Posted - 05/11/2018 :  09:55:12  
Following instructions here: [url]https://www.ecommercetemplates.com/seo/search-engine-friendly-urls-php.asp[/url]. Works fine for product detail pages, but for categories I still get: products.php?cat=8

I've made the includes.php changes and the .htaccess, but not yet the 301 redirects.

[url]https://www.mad-trees.com[/url]

Andy
ECT Moderator

95440 Posts

Posted - 05/11/2018 :  09:56:52  
Hi

It looks like it is working fine for the internal navigation. You'll need to change the menu links to point to the new URLs.

Andy

Please feel free to review / rate our software

on_edge
Advanced Member

USA
275 Posts

Pre-sales questions only
(More Details...)

Posted - 05/11/2018 :  10:13:09  
Can I change this to say plants instead of products?

$seoprodurlpattern="/products/%s";

Andy
ECT Moderator

95440 Posts

Posted - 05/11/2018 :  10:16:56  
Yes, you can but also make the corresponding change in the .htaccess file.

Andy

Please feel free to review / rate our software

on_edge
Advanced Member

USA
275 Posts

Pre-sales questions only
(More Details...)

Posted - 05/11/2018 :  10:47:29  
So, what is my link to what was categories.php?

on_edge
Advanced Member

USA
275 Posts

Pre-sales questions only
(More Details...)

Posted - 05/11/2018 :  10:50:16  
And the link to view all products (plants)?

Andy
ECT Moderator

95440 Posts

Posted - 05/11/2018 :  10:57:19  
I would use the internal navigation to get the correct links and copy those to your menu.

Andy

Please feel free to review / rate our software

on_edge
Advanced Member

USA
275 Posts

Pre-sales questions only
(More Details...)

Posted - 05/11/2018 :  10:59:28  
Figured these out. But for all plants, I now have /plants/products/

Andy
ECT Moderator

95440 Posts

Posted - 05/11/2018 :  11:10:48  
What do you have in includes.php and the .htaccess file for the new Urls?

Andy

Please feel free to review / rate our software

on_edge
Advanced Member

USA
275 Posts

Pre-sales questions only
(More Details...)

Posted - 05/11/2018 :  11:13:32  
Includes:
$seodetailurls=TRUE;
$seocategoryurls=TRUE;
$detlinkspacechar="-";
$seocaturlpattern="/category/%s";
$seoprodurlpattern="/plants/%s";

.htaccess:

[code]<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^category/([^/.]*)/?$ /categories.php?cat=$1 [QSA,nc,L,B]
RewriteRule ^plants/([^/.]*)/?$ /products.php?cat=$1 [QSA,nc,L,B]
RewriteRule ^manufacturer/?$ /categories.php?man=all [QSA,nc,L,B]
RewriteRule ^manufacturer/([^/.]*)/?$ /products.php?man=$1 [QSA,nc,L,B]
RewriteRule ^([^/.]+)$ proddetail.php?prod=$1 [QSA,nc,L,B]
</IfModule>[/code]

on_edge
Advanced Member

USA
275 Posts

Pre-sales questions only
(More Details...)

Posted - 05/11/2018 :  11:18:54  
For consistency, it would be great to make search.php, cart.php and contact.php extentionless.

Andy
ECT Moderator

95440 Posts

Posted - 05/11/2018 :  11:28:31  
The URLs work fine for me. Could be you have .htaccess file cached.

Andy

Please feel free to review / rate our software

on_edge
Advanced Member

USA
275 Posts

Pre-sales questions only
(More Details...)

Posted - 05/12/2018 :  12:14:56  
Right. URLs work fine. I'm referring to how they appear. With SEO Friendly URLs for the products, there are no file extensions (https://www.mad-trees.com/Boxwood-~-Buxus-Microphylla-Green-Mountain)

But non-product pages like search, about, privacy, contact, etc. have a .php extension (https://www.mad-trees.com/contact.php).

I suppose I could use this in .htaccess as I have for other sites.

[code]<IfModule mod_rewrite.c>
# For security reasons, Option followsymlinks cannot be overridden.
# Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
RewriteBase /

# Add trailing slash to url
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
RewriteRule ^(.*)$ $1/ [R=301,L]

# Remove .php-extension from url
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^\.]+)/$ $1.php

# Remove .html-extension from url
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^\.]+)/$ $1.html

# End of Apache Rewrite Rules
</IfModule>[/code]

Andy
ECT Moderator

95440 Posts

Posted - 05/12/2018 :  13:13:13  
The extensionless URLs are for the product based pages. I think you may run into problems using that approach for some other pages like cart.php or thanks.php.

Andy

Please feel free to review / rate our software
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000