skip to Main Content

Using PHP for canonical urls – SEO

I set the following rule in my .htaccess file to redirect example.com/index.php to example.com RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ /$1 [R=301,L] Then I set my canonical as following in the header.php for all pages: <link rel="canonical" href="https://www.example.com<?php echo $_SERVER['PHP_SELF']; ?>"…

VIEW QUESTION

Magento hreflang Implementation

Using code from a previous discussion (link:https://magento.stackexchange.com/questions/12504/how-to-add-hreflang-tags-or-other-meta-tags-to-pages-in-magento), I was able to implement the hreflang links into our Magento site. Here is the code that worked for me: <?php foreach (Mage::app()->getWebsites() as $website) { foreach ($website->getGroups() as $group) { $stores =…

VIEW QUESTION

How to make Canonicals with PHP – SEO

I've search around on SO, but can't find an exact answer to my needs. Generating a URL is pretty easy... Like so: <link rel="canonical" href="https://example.com<?php echo ($_SERVER['REQUEST_URI']); ?>" /> But, the issue with this is, the $_SERVER['REQUEST_URI']) will always fetch…

VIEW QUESTION

How to set canonical URL for 2 part blog entry? – SEO

I have a blog with Photoshop tutorials and because some of my tutorials are quite long I've decided to split the content into parts http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx?part=2 and set the canonical rel for both pages to http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx Is this better than…

VIEW QUESTION
Back To Top
Search