Blog

How I Got Clean URLs For My Blog

Permlink | Comments
By: Anton McClure;
Published:
Tags: General; Technology;

A simple and effective solution for SEO-friendly URLs that can be used with virtually any web app.

AntonMcClure.com alternate logo.
AntonMcClure.com alternate logo.

Like many people and organizations, my site has portions that are powered by open source software. An example of that would be the code powering this blog my old blog, from tilde.team (with permission from Ben, of course).

This code worked, for the most part, but URLs were written like

https://www.antonmcclure.com/blog/?page=name

rather than an SEO-friendly

https://www.antonmcclure.com/blog/name

In order to fix this, some NGINX code is needed.

The rewrite code that worked for me is shown below:

location /blog/ {rewrite ^/blog/(.*)$ /blog/index.php?page=$1 last;}

Feel free to use and adapt this in your NGINX configs as you deem necessary.


Also on:


About the Author

Recent Posts

Image from piqsels. Licensed under public domain.
How Software as a Service (SaaS) Can Improve Your Business

By: Anton McClure;
Published: July 1, 2020
Tags: Technology; SaaS; Business;
You want your business to be successful, and modern cloud technologies such as SaaS can help make that success happen.

Title card - Image features an SSH connection Lily Winter's
How to Get Started with Tildes

By: Anton McClure;
Published: June 30, 2020
Tags: Technologies; Tildes; Open Computing;
Many public-access servers called "tildes", many of which are actively accepting new users. Here's how you can join and start making the most of your new tilde account.

Image by Pete Linforth (TheDigitalArtist). Image licensed under the Pixabay License.
Microsoft Gives Linux and Android a Significant Security Upgrade

By: Anton McClure;
Published: June 24, 2020
Tags: Android; Linux; Microsoft; Security;
Microsoft has released their Defender ATP platform for Linux and Android devices. Here are some of the benefits it brings, and how you can deploy it.

Image from pxfuel. Free for commercial use.
Making the Internet and its Content Accessible for More People

By: Anton McClure;
Published: June 14, 2020
Tags: General; Internet;
Mobile devices are bringing the Internet to more people than ever before. Here's ways we can improve their online experience.

Screenshot from me deleting a WordPress site from my VPS.
(Why) I Won't Use WordPress, and Why You Shouldn't Either

By: Anton McClure;
Published: June 5, 2020
Tags: Technology; Alternatives; Security; Internet;
WordPress is popular, but there are better programs out there.

Image by OpenClipart-Vectors. Image licensed under the Creative Commons Zero (CC0) license.
Zoom Free Users Will Not Have End-to-End Encryption

By: Anton McClure;
Published: June 4, 2020
Tags: Technology; Encryption; Alternatives;
Zoom CEO has stated free users will not get end-to-end encryption. Here are some good alternatives to Zoom you could use instead.