AlmaLinux WordPress Permalink URL Mapping Tutorial

AlmaLinux WordPress Permalink URL Mapping Tutorial

AlmaLinux WordPress Permalink URL Mapping Tutorial

On this WordPress blog (now on AlmaLinux rather than CentOS) you are reading we have this permalink arrangement whereby URLs to blog postings have within them a representation of the blog posting title. We might be dreaming, but we think the arrangements for this “mapping of URLs” might have changed with the migration environment change. This would not be surprising. We think the way a “/” (forward slash) character that appears in a blog posting title might now “map” to a “-” (minus) character rather than to nothing that my CentOS dreams never forewarned me of, regarding … tut, tut!

To remedy this, we started fiddling around with good ol’ TwentyTen theme’s good ol’ headergood ol’.php code where we have many places where we simulate what must go on behind the scenes in WordPress.org based permalink code thinking. And then, we remembered twin good ol’ 404twin good ol’.php methodologies for URLs that are not found, and though many will see this as a klunky solution … god knows Luna and Nala find it pretty amusing … we kind of like

<?php

$uparts=explode("/", $_SERVER['REQUEST_URI']);
if (strpos($_SERVER['REQUEST_URI'], 'apachephp') !== false) {
header('Location: ' . str_replace('--','-',str_replace('apachephp', 'apache-php-', $_SERVER['REQUEST_URI'])));
exit;
}
if (strpos($_SERVER['REQUEST_URI'], 'htmljavascript') !== false) {
header('Location: ' . str_replace('--','-',str_replace('htmljavascript', 'html-javascript-', $_SERVER['REQUEST_URI'])));
exit;
}
if (strpos($_SERVER['REQUEST_URI'], 'phpjavascript') !== false) {
header('Location: ' . str_replace('--','-',str_replace('phpjavascript', 'php-javascript-', $_SERVER['REQUEST_URI'])));
exit;
}


?>

… as the dawn of klunky thinking around here?!

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Tutorials and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *