First, I want to preface that I am not very good with php so I am looking for some guidance. I'm working on a website using Dreamweaver that is being accessed through .davaccess
each php page has the following variables:
<?php
require_once "../config.php";
$title="Custom Title I enter";
$metaDescription="Custom Description I enter.";
include_once (INCLUDES_PATH . "/header.php");
?>
And the header.php includes this section:
<title><?php echo $title; ?></title>
<meta name="description" content="<?php echo $metaDescription ?>" />
<base href="<?php echo $config['urls']['baseUrl'] ?>">
My thought is that I need to add something in the header file so I can add my own URL on the individual pages. Based on how the title and description have worked, I tried including the following:
<link rel="canonical" href="<?php echo $canonical ?>" />
but that ends up just making each page canonicalize to the base URL, before I add anything to individual pages.
What I'm looking for is a way to add some code that can autopopulate the current URL as the canonical, and possibly update it on individual pages if necessary. Any help would be greatly appreciated. Thank you