I am working on an e-commerce website with a category page for each model in stock.
The category page let the visitor compare the main characteristics of products before accessing more details on the product pages.
When the visistor access a category, if there is only one product in it, he is directly redirected to the product page, where he will find all necessary information about the unique available product for the given category.
The redirection is performed through the PHP function
By default, the HTTP header set by the
header() function is a 302 Temporary redirection.
Basically, I like the fact that the (temporarily unique) product is reached by passing through its category, as it keeps the navigation logic and makes the code easier to understand and maintain.
As the stock is kept as diverse as possible, there is a unique product in stock for many models. In Google Search Console, this situation causes a high percentage of pages that were detected but not indexed because of the redirection.
The fact that the one-product-category pages are not indexed is not a problem in itself, but I assume it is not that good for SEO as search engines detect the large number of redirections.
One understands that, as for the logic, the one-product-category pages themselves never moved. They will just appear once more than one product is present in them. But on the technical side, things are viewed differently.
I tried to improve the situation by adding a sitemap of categories, where only the categories containing at least two products are listed, and removing some links to the one-product categories. The laters are however still reachable from the list of the models in stock.
All products are listed in sitemaps, so that they can be found even without passing through the categories.
I wonder if I should rather:
A. use some slightly "black hat" technique of cancelling the PHP redirection if the visitor is detected as a bot, so that the category page is made visible to bots even if there is only one product in it. This would make the category page indexable and it would likely stay low in the ranking because of the little information it contains.
B. add a
rel="nofollow" attribute to the links to the categories that contain only one product.
Of course, I don't want to penalize the category pages for later time in case they would contain more products.
Although I am fundamentally against tricking, I have a small preference for A in this context, but would like to hear advice or ideas for SEO experts.