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
|
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
|
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
|
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
|
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
|
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
|
|
|