I currently maintain the backend php code for a website which allows our sales representatives to sell products and services. If a sales representative is active, he/she is given a "custom" website URL which essentially tags any activity on that particular site to that representative. Sales are only collected on representative websites (we do this to 'protect' our employees and make sure they feel we are not selling behind their back on an open parent site).
For example:
www.site.com may highlight all the products and services available but does not give a customer the ability to purchase
www.site.com/SOMEREPCODE where SOMEREPCODE is a unique identifier to a specific agent, presents the same options but opens the ability to sell that product. There are thousands of these sales representatives, therefore thousands of links pointing to the same page and content.
There has been a lot of debate as to whether we should open the site up to front end sales as well recently. Our industry is very specific so we are not too worried about lost sales from web shoppers but I do believe they exist. Some of our front end developers have "noindex, nofollow" code on the pages and we are told this is to prevent Google and others from 'blacklisting' the site as trying to have multiple links all going to the same content (think SOMEREPCODE representing over 1000 sales representatives with nearly the exact same page minus name and contact number shown).
edit - showing htaccess file
#if file or directory do not exist, try as an repid
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9a-zA-Z-]+)$ index?Rep=$1 [QSA,NC,L]
The htaccess logic above checks to make sure the code entered is not an existing file or directory. If it is not, the SOMEREPCODE is stored as a variable to index?Rep=SOMEREPCODE.
At the top of my index page, I include a function to then check if the value of Rep is a valid sales representative and if they are active. If invalid or not active, the page is redirected to a landing page giving an error. If the rep is active and exists, the page continues to load after setting the appropriate SESSION variables.
indexInclude
<?php
if(isset($_GET['Rep']) && $_GET['Rep'] != NULL) {
//DB connectors called
$sql = "SELECT * FROM reps WHERE repcode = ? AND status = 'Active' LIMIT 1";
$stmt = $db->prepare($sql);
$stmt->execute(array($_GET['Rep']));
while ($row = $stmt->fetch()) {
$_SESSION['repname'] = $row['repname'];
//collect other rep information
}
if( !isset($_SESSION['repname']) && empty($_SESSION['repname']) ) {
header("Location: unavailable");
exit;
} else {
$_SESSION['sales'] = "Y";
}
} elseif( !isset($_SESSION['sales']) && !isset($_GET['Rep']) ) {
$_SESSION['sales'] = "N";
}
?>
The index page does not change at all in this case, only areas of the site that 'display' in the presence of $_SESSION['open'] == 'Y'.
Is this in fact true? Are there ways to handle this situation which would allow us to open the site up for web sales as well?