Scroll to top

06/12/2025

The home on the web of Colin Walker. Find out more on /about, say /hello, or sub to the daily RSS feed.

2025/12/06#p1

# 0 comments: click to leave a comment

When I started using the home page, the blog was moved to /blog/ and has been there ever since. This feels a bit unwieldy, so I started looking at options to simplify the URL structure.

I didn't want to move everything back to the root as that would get too messy. What were the alternatives?

There were already a number of redirects happening in .htaccess to ensure things worked. It made sense, therefore, to look at expending on this.

Having DirectoryIndex /blog/ in the root .htaccess causes the server to deliver the blog while keeping the address bar as showing the root. So, an address like /blog/?date=2025-12-06 becomes /?date=2025-12-06.

The rest came down to making sure all links and calls functioned correctly, and automatically removing /blog/ from URLs in post content – I just added a str_replace() in my content filter.

Everything looks to be working correctly but, if you find any issues, just shout.

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



Close