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
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Solved: manufacturers.php with SEO friendly URL's
Author « Topic »  

ITZAP
Ecommerce Template Expert

Australia
927 Posts

Posted - 01/18/2022 :  17:53:17  
Running Ecommerce Plus PHP v7.4.6

My question relates to setting up a manufacturers.php page with custom <title>, <meta name="Description">, <h1>custom heading</h1> and <p>custom description</p>

Making this work using Vanilla URL's is very easy. And renaming the manufacturers page to brands.php works fine as well.



But when you activate the Search engine friendly URL's I just cannot get the Redirect to either manufacturers.php or brands.php to work at all.

What happens is the Redirect goes to categories.php?man=all regardless. Sure, that does list all Manufacturers/Brands. But I want to display the brands.php page with custom <title>, description, <h1>heading and description.

Yes, I have followed the instructions. Here is my configuration.

includes.php

// ==>> SEO FRIENDLY EXTENSIONLESS URLs v6.4
$seodetailurls=TRUE;
$seocategoryurls=TRUE;
$detlinkspacechar='-'; // For proddetail.php 'Has Static URL' filename, use dashes to separate words entered
$urlfillerchar='-'; // For proddetail.php page, use-dashes-to-separate-words in Product Name
$seocaturlpattern="/category/%s"; // category.php page URL pattern
$seoprodurlpattern="/pages/%s"; // products.php page URL pattern
$seomanufacturerpattern="/brand/%s"; // Product Attribute Group Name 'Brand' URL pattern
$seourlsthrow301=TRUE; // Enable this when SEO URLs are working to generate HTTP 301 Moved Permanently error advice for Search Engines


// MANUFACTURER rename to Brand
$manufacturerpageurl="brands.php?man=all";
$xxManuf='Brands'; // Appears in Breadcrumb link on products.php listing
$manufacturerfield="Manufacturer"; // (optional) Show Manufacturer field info on the proddetail.php page (I think this is Obsolete)
$GLOBALS['xxManLab']='Brand'; // Change label from default Manufacturer


.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Search Engine Friendly Extensionless URL's
RewriteRule ^category/([^/.]*)/?$ /categories.php?cat=$1 [QSA,nc,L,B]
RewriteRule ^pages/([^/.]*)/?$ /products.php?cat=$1 [QSA,nc,L,B]
RewriteRule ^brand/?$ /brands.php?man=all [QSA,nc,L,B]
RewriteRule ^brand/([^/.]*)/?$ /products.php?man=$1 [QSA,nc,L,B]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) proddetail.php?prod=$1 [QSA,nc,L,B]
</IfModule>


Any advice about why the brand RewriteRule does not work would be very much appreciated.

Gary

Edited by - ITZAP on 01/20/2022 21:05:07

Vince
Administrator

41216 Posts

Posted - 01/19/2022 :  01:24:03  
Hi Gary
This is what works for me, but if this doesn't help then please let me know and I'll dig deeper...

includes.php

// ==>> SEO FRIENDLY EXTENSIONLESS URLs v6.4
$seodetailurls=TRUE;
$seocategoryurls=TRUE;
$detlinkspacechar='-'; // For proddetail.php 'Has Static URL' filename, use dashes to separate words entered
$urlfillerchar='-'; // For proddetail.php page, use-dashes-to-separate-words in Product Name
$seocaturlpattern="/category/%s"; // category.php page URL pattern
$seoprodurlpattern="/pages/%s"; // products.php page URL pattern
$seomanufacturerpattern="/brand/%s"; // Product Attribute Group Name 'Brand' URL pattern
$seourlsthrow301=TRUE; // Enable this when SEO URLs are working to generate HTTP 301 Moved Permanently error advice for Search Engines

// MANUFACTURER rename to Brand
$manufacturerpageurl="brand/";
$xxManuf='Brands'; // Appears in Breadcrumb link on products.php listing
$manufacturerfield="Manufacturer"; // (optional) Show Manufacturer field info on the proddetail.php page (I think this is Obsolete)
$GLOBALS['xxManLab']='Brand'; // Change label from default Manufacturer

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Search Engine Friendly Extensionless URL's
RewriteRule ^category/([^/.]*)/?$ /categories.php?cat=$1 [QSA,nc,L,B]
RewriteRule ^pages/([^/.]*)/?$ /products.php?cat=$1 [QSA,nc,L,B]
RewriteRule ^brand/?$ /categories.php?man=all [QSA,nc,L,B]
RewriteRule ^brand/([^/.]*)/?$ /products.php?man=$1 [QSA,nc,L,B]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) proddetail.php?prod=$1 [QSA,nc,L,B]
</IfModule>

And you don't actually need the physical "brands.php" page as it's all done by URL rewriting to the categories.php and products.php pages.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

ITZAP
Ecommerce Template Expert

Australia
927 Posts

Posted - 01/19/2022 :  17:22:13  
Hi Vince, thanks for the reply.
I tried your settings and they produce exactly the same result as mine.
quote:
you don't actually need the physical "brands.php" page as it's all done by URL rewriting to the categories.php and products.php pages.
RewriteRule ^brand/?$ /categories.php?man=all [QSA,nc,L,B]

The result here is the list of Menu Categories and the list of Manufacturers both appear with identical <title>, <h1> heading and short description.
quote:
My question relates to setting up a manufacturers.php page with custom <title>, <meta name="Description">, <h1>custom heading</h1> and <p>custom description</p>
At the present time the answer is no, you cannot do this if using the search engine friendly URL's, which is a pity.

So perhaps this belongs in the Suggestion Forum.

I believe that the better solution would be to look into altering the URL RewriteRule to Redirect to a manufacturers.php (or brands.php) page. This way webmasters can present a unique page <title>, <h1> heading and short description to visitors and the search engines, like this ...


<head>
<title>Leading Brands available from ABC Computers Pty Ltd</title>
<meta property="og:title" content="Leading Brands available from ABC Computers Pty Ltd">

<meta name="Description" content="ABC Computers stock all leading brands of computer gear and IT components. Here you can browse our product range according to manufacturer.">
<meta property="og:description" content="ABC Computers stock all leading brands of computer gear and IT components. Here you can browse our product range according to manufacturer.">
</head>

<body>
<h1>Leading Brands available from ABC Computers Pty Ltd</h1>
<p>ABC Computers stock all leading brands of computer gear and IT components. Here you can browse our product range according to manufacturer.</p>
<?php include "vsadmin/inc/inccategories.php" ?>
</body>

And when the visitor clicks on a manufacturer, products.php takes over and presents that Manufacturer <h1> heading, description and page list as usual.

Regards,

Gary

Edited by - ITZAP on 01/19/2022 17:33:49

Vince
Administrator

41216 Posts

Posted - 01/20/2022 :  01:35:28  
Hi Gary
Ok, my apologies and I missed the point there a bit. But can't you do a bit of jiggery pokery with the title. Just a for instance...

<title><?php
if(getget('man')=='all')
print 'your all manufacturers title';
else
print 'Leading Brands available from ABC Computers Pty Ltd'; ?></title>

The metainfo.php script will automatically detect that the page is a manufacturer page and populate $sectionname and $sectiondescription anyway, but you can interrogate the query string to see what parameters are in it if you want to fine tune.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

ITZAP
Ecommerce Template Expert

Australia
927 Posts

Posted - 01/20/2022 :  20:21:36  
Wowee, that works a treat Thanks so much Vince !

categories.php


<head>
<title><?php
if(getget('man')=='all') {print $rootmanufacturertitle;}
else if(!empty($pagetitle)) {print $pagetitle;}
else if(!empty($sectionname)) {print $sectionname . ' | ' . $sitename;}
else {print $rootcategorytitle;} ?></title>

<meta name="Description" content="<?php
if(getget('man')=='all') {print $rootmanufacturerdescription;}
else if(!empty($sectiondescription)) {print str_replace('"','"',$sectiondescription);}
else {print $rootcategorydescription;} ?>">
</head>

<body>
<h1><?php
if(getget('man')=='all') {print $rootmanufacturertitle;}
else if(!empty($pagetitle)) {print $pagetitle;}
else if(!empty($sectionname)) {print $sectionname;}
else {print $rootcategorytitle;} ?></h1>

<?php include_once ( $_SERVER["DOCUMENT_ROOT"] . "/vsadmin/inc/inccategories.php") ?>
</body>



That makes manufacturers.php (or brands.php) obsolete. A very clever solution. Thanks again

Gary

Vince
Administrator

41216 Posts

Posted - 01/21/2022 :  01:13:49  
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2021 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000