Header Image - FOSS adventures

Monthly Archives

One Article

Breaking my WordPress website with Permalinks and Nginx

My first challenge is setting up my WordPress website correctly. I have ordered the e-book “WordPress Visual Step by Step for Beginners 2018” by Alvin Wells. The book is 103 pages in length and contains the basic instructions for setting up a WordPress site. It is practical enough to get started.

Before my adventure started, I had already looked at various WordPress themes. I decided on the Cannyon theme, as it featured a good looking green color scheme. That’s a solid basis for a website focused on openSUSE. The theme has a very nice layout for the blog section, with attractive use of images and a simple navigation structure. As the blog is the most important part of this website, this theme seemed to be a good choice. I designed the website to my liking and wrote my first blog post.

Back to the e-book. What’s next? The settings tab and how to change the permalink appearance. The default was set to “Plain” and I wanted to change this to “Post name”. I changed the setting, reloaded the website and tried to access my first post. A 404 error. Then I read the sentence: “Just make sure that you don’t go jumping between link structures since it will break your site”. Oh, snap!

So how to fix it? Google to the rescue. Soon enough I found the generally accepted answers (1), (2) and (3). I just needed to edit my nginx.conf file to include the following within the server block:

location / {
                try_files $uri $uri/ /index.php?$args;
}

Was this the solution? I changed the permalink settings, reloaded the website… and no luck. A couple of hours and many variations later… and still no luck. I realized that I needed to improve my Nginx skills to get this problem resolved. I am not the person to give up that easily. After all, this website is a learning experience. I ordered the book: “Nginx HTTP Server: Third Edition” by Clément Nedelcu. It’s a fascinating read so far (if you like to dive deep into technology). In a future blog post, I will detail if I have managed to solve this problem and how I have solved it.

Published on: 19 March 2018