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

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site

 All Forums
 Search Engines & Marketing
 SEO friendly URLs Google Search -Solved
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic   

Starting Member

31 Posts

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

Posted - 10/28/2019 :  09:31:31  
While using the SEO Friendly URLs, I had invalid urls indexing as a valid page in Google Search Console.
My products.php is rewritten to /stone-products/
and my categories.php is rewritten to /stone-category/

The url /stone-products/[any string of text] would resolve to my "all products" - this resulted in thousands of pages being indexed because we had 25 pages of products. So the end result would be that the url /stone-products/[any string of text]?pg=1-25 was being indexed for any string of text.

I ended up testing for a numeric $GLOBALS['catid'] or an empty value to display the incproducts.php and if not, display an error message and throw a 404 error.

Here's the code for the products page:

if ((is_numeric($GLOBALS['catid'])) || (($GLOBALS['catid'])=='')){
include "[storedir]/inc/incproducts.php";
else {
header("HTTP/1.0 404 Not Found");
echo '<p><em>'.$GLOBALS['xxSryNA'];
echo '<p>';
include "[storedir]/inc/inccrosssell.php";
echo '</p>';

This is category page:

[code]if ((is_numeric($GLOBALS['catid'])) || (($GLOBALS['catid'])=='')){
include "vsadmin/inc/inccategories.php";
else {
header("HTTP/1.0 404 Not Found");
echo '<p><em>'.$GLOBALS['xxSryNA'];
echo ' Need something else?</em></p>
echo '<p>'
.'New Inventory';
include 'vsadmin/inc/inccategories.php';
echo '</p>';


RewriteOptions inherit

RewriteEngine On

<IfModule mod_rewrite.c>

RewriteBase /

RewriteRule ^stone-category/([^/.]*)?$ /categories.php?cat=$1 [QSA,nc,L,B]
RewriteRule ^stone-products/([^/.]*)?$ /products.php?cat=$1 [QSA,nc,L,B]
#RewriteRule ^manufacturer/([^/.]*)/?$ /products.php?man=$1 [QSA,nc,L,B]
RewriteCond $1 !\.(png|gif|jpg|ico|pdf|css|js|php|xml|html|htm)$ [NC]
RewriteRule ^([^/.]+)$ proddetail.php?prod=$1 [QSA,nc,L,B]

Hope this solution helps someone else!

Thank you,

Edited by - stonewx on 10/28/2019 21:56:28


39856 Posts

Posted - 10/28/2019 :  10:56:15  
Hi Lynne br / Am I understanding correctly that the $_SERVER[ REQUEST_URI value isn't what you think it should be? If that's the case, have you tried printing out the value to see if it agrees with what you think it should be? Or even, display all the server variables with for instance...

foreach($allserver as $key => $value){
print '<div style="width:300px;text-align:right;float:left">' . $key . ' : </div><div> ' . $value . "</div>";

Does that help at all? Or am I not getting the right idea?


Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2020
This page was generated in 0.02 seconds. Snitz Forums 2000