I have a few rewrite rules that allow me to have specific URLs for search paremeters. For reference, they are:
add_filter('rewrite_rules_array', 'mmp_rewrite_rules');
function mmp_rewrite_rules($rules)
{
$newRules = array();
$newRules['floorplan/(.+)/(.+)/(.+)/?$'] = 'index.php?floorplan=$matches[3]';
$newRules['ready-made/(.+)/(.+)/(.+)/?$'] = 'index.php?ready_made=$matches[3]';
$newRules['floorplan/(.+)/(.+)/?$'] = 'index.php?county=$matches[2]';
$newRules['ready-made/(.+)/(.+)/?$'] = 'index.php?county=$matches[2]';
$newRules['floorplan/(.+)/?$'] = 'index.php?county=$matches[1]';
$newRules['ready-made/(.+)/?$'] = 'index.php?county=$matches[1]';
return array_merge($newRules, $rules);
}
My concern now is that with these wildcards within them, you can essentially put anything in those slots and be navigated to the correct page, as long as the rest of the URL is valid.
I’m still very shaky on understanding the SEO side of things, and how links are indexed in general. Is this a huge problem, and if so, how can I address it?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
This is somewhat opinion based answer, and is specific to SEO, not necessarily WordPress.
Generally a URL should refer to a specific entity, and a/b/c often implies a relationship between a/b/c like b is a parent or container of c, a is a parent or container of b. So it doesn’t make much sense that a/b/c, b/a/c and x/y/c all reference the same thing.
SEO with page rank (the basis of Google’s search results) works by conferring a higher score to pages that have more pages linking to them. So if for some reason you end up with 3 popular URL’s a/b/x, c/d/x and /e/f/x that all show the same content x, then you’ve lost some SEO rank because if everyone referred to a/b/x it would rank higher.
OTOH, I don’t see that this will do any harm. It leaves you open to people publishing abusive URL’s maliciously, or messing up URL’s accidentally, but this is likely possible in some way with most websites. It also means that in future if you decide to fix/change this you have to allow for all the formats that people have used that are live on the web so those links don’t break.
I would be more worried about making sure that URL’s used in promoting and internally on the site follow a consistent pattern. If you can, pick one form and use it everywhere.
HTH
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0