Dude, Where’s My Site Map?!
You know how it goes, new site, zippy server … but where’s your site map gone? Here’s the Little Fire Story …
TLDR?
A WordPress site relies on .htaccess to build the redirects to make a call to a site map work. NGINX ignores .htaccess … if you want all the performance of NGINX and you want your website to work … you’ll need an app like this.
So What’s a Site Map?
A site map is a list of all the pages you want users and Google to find (it may not be all the pages on the site). Many websites have two:
- An HTML site map – HTML pages will have layout, images and styling (likely to match the rest of the website). This is easy for for us puny humans to read.
- An XML site map – this just a big list of links and associated data specifically optimised for Google and other search engines to read and rapidly locate the pages that you wish the search engine to return in search results.
For web designers, developers and SEO agencies, the XML site map is the one that matters. If search engines aren’t letting people know about your website, all the time, effort and love which was poured into the new website is going to waste – pages will remain unseen, products unsold and opinions unshared.
This is the story of how we lost ours and how we got it back …
A Quick Word of Warning …
There are other answers to this question but this took us (and two technical support departments) some time to crack.
So we’re putting this here …
This article relates specifically to WordPress websites hosted using NGINX and employing the Yoast SEO (Search Engine Optimisation) plugin. The rules written are applied using an up-to-date Plesk installation. If you’re using WordPress and serving your site over Apache then there are useful articles – elsewhere (links at the bottom).
Another Word of Warning …
This article is geeky. It is rammed with jargon (sorry!). We’ve written an article to try to demystify as much jargon as we can.
Fixing this issue also requires access to the configuration or control panel on the server which your website is hosted.
If both of these issues are insurmountable and you still cannot find your sitemap, drop us a line. We know this stuff so you don’t have to.
Here We Go …
So, every six years or so, whether we need to or not, we update our website. This time, rather than using our bespoke vCMS web design platform we decided to take advantage of the powerful WordPress web design environment.
It’s not the end of vCMS but that is another story.
We spent significant time generating new content for the new website: we used our new marketing firepower to make sure it reflected the needs of new and existing clients; we slavishly followed YouTube tutorials to create engaging animations and we scoured our archive for the best images and stories to tell the world about who we are.
We worked hard to make the website perform well: we employed cacheing plugins to overcome any site speed issues and, rather than relying on the Apache web server we had used for so long, opted to use the high-speed NGINX web server supplied with PLESK.
We’d tested our website extensively so we launched our new website. We submitted the site map URL (as specified by Yoast) to Google Search Console and got on with real life …
What is NGINX?
According to NGINX themselves:
NGINX is open source software for web serving, reverse proxying, caching, load balancing, media streaming, and more. It started out as a web server designed for maximum performance and stability.
https://www.nginx.com/resources/glossary/nginx/
In short, when you ask for a web page or data from your app or browser, NGINX is running on our web server ‘listening’ for that request and returning that information to you.
Most of the websites hosted on a UNIX or LINUX servers (which is a big most of most of the websites in existence) use Apache to send web pages to your browser.
Apache has been around a long time and has seen many changes (the name is a joke – “A Patchy Web Server”).
It’s still a great piece of software. But NGINX is a modern web server specifically written for a modern environment.
We felt that that our most important website deserved the best and fastest delivery system available.
A Few Weeks Later …
… we gave Google a bit of time to digest all of our new content goodness and wen’t back to Google Search Console see how our content was stacking up.
We navigated to the Site Maps and saw that Google had indexed nothing … and Google was giving the opaque warning
‘Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead.’
All that time wasted! So we went and looked at our specified site map URL (https://little-fire.com/sitemap_index.xml since you ask). Horrors! Not only was it not showing the site map – the server was redirecting us to our homepage.
So What Had Happened?!
We asked a lot of people – people who ought to know better (Yoast, Brizy, WordPress) and no-one had an answer. It took us days of panicked Googling to find out – in the end it took a bit of a Eureka moment.
We finally figured it out. Like most PHP websites, WordPress relies on .htaccess.
What is .htaccess?
The .htaccess file, abbreviated from “hypertext access,” is a configuration file used on web servers running the Apache web server software. It enables webmasters to control and customise the server’s behaviour on a per-directory basis by providing a means to override the global configuration settings. This file is often employed to manage various aspects of a website, including URL redirection, access control, password protection, and custom error pages. Its flexibility and ease of use make .htaccess a powerful tool for shaping the behaviour of web servers and enhancing the security and functionality of websites without the need for server-wide configuration changes.
So?
It turns out NGINX ignores .htaccess. It doesn’t seem well known. But it is that simple.
So What Can You Do?
Fortunately, there are quick fixes:
- You can revert to Apache – it’s still a great piece of software
- but if you want all the performance of NGINX and you want your website to work … you’ll need an app like this. It is not easy and will take some messing but it can get you the results you need.
We reverted to apache – we‘ve always liked it and it can still be made to run very fast.
Are You Stuck?
Talk is free. Find out how we can help you.