Internal links
If you wanted to add a link from one page on your website to another page on your website, how would you do it?
Chances are you’d copy the full webpage url, something like 'www.mywebsite.co.uk/great-content' and paste it to create a hyperlink on the page. Internal links like these are important for search engine optimization (SEO) and to help people navigate between pieces of relevant content on your website.
But did you know that you can help to future-proof internal links by making a small tweak?
Instead of using the full url (with the domain – i.e. the name of your website) you can just use the page path, this is the part that comes after the domain.
For example:
Full url: www.mywebsite.co.uk/great-content
Page path: /great-content
Don’t get caught out!
An easy mistake to make is to only copy the path from the final forward slash ‘/’ – but for the link to work you need to copy everything that comes after the domain.
For example:
Full url: www.mywebsite.co.uk/event/how-to-write-great-content
Incorrect: /how to-write-great-content
Correct: /event/how to-write-great-content
Drupal 9 and future-proofing
You might be wondering how using a page path can help you in the future - there are two ways this method of creating internal links can simplify things:
Site upgrades
When you have a significant website upgrade, developers will create the new site alongside your existing one. This minimizes ‘down time’ when implementing the upgrade and allows for testing of new features. The ‘staging’ site will have a different domain name while it is in development – this means you won’t be able to use the full url to create internal links as they won’t work once the site goes live.
Using page paths means you will be able to test internal links before the website goes live. If you haven’t already undergone the upgrade to Drupal 9 – using page paths for your internal links could really help to save you a headache and a lot of time!
Changes to your domain
Although this is less likely to occur, if you change your website domain, either by changing the domain name or the domain extension (the ‘.co.uk’ part, for example), this will affect all of the internal links on your website where you have used the full url. By using page paths you save yourself the considerable time you would spend updating all of these links and you don’t run the risk of missing a link that needs to be updated.
The time it takes to update your internal page paths on your core pages - and to bring your team up to speed so this can be a standard approach going forward - can help to make any future website upgrades go more smoothly.
Red Hot Tips
If you’ve used this Red Hot Tip or have any queries we’d love to hear about them. Get in touch with us via Twitter @RedHotIrons or email info@redhotirons.com.