.htaccess

Some useful directives for .htaccess

Turn on Rewrite:
RewriteEngine On

Configure the base path
RewriteBase /

Forces HTTPS and without WWW
RewriteCond %{HTTP_HOST} ^visualgui.com
RewriteRule (.*) https://visualgui.com/$1 [R=301,L]

Redirect everything file in a directory
RewriteRule ^old-dir/(.+)$ /new-dir/$1 [R=301,L]

Redirect old URL to new URL
Redirect /old-file/ /new-file/

Custom 404
ErrorDocument 404 /404.php

Prevent directory listing when index file is not present
Options -Indexes

Update to PHP 8.4

WordPress’s Site Health recommended that I should upgrade to PHP 8.3. I didn’t even realize that I was running on PHP 8.2. I googled for tutorials on how to update PHP on my DigitalOcean’s Droplets. Of course, I took a snapshots of my Droplets. Unfortunately, none of the tutorials I found worked. I had to restored my snapshots a couple of times. After about two hours, I almost gave up. Then I came across my own write up how I upgraded to PHP 8.2. All I had to do was replacing 8.2 with 8.4. I skipped 8.3. I also removed all old PHP packages and only leave 8.4. I was so glad that I documented all of the things I did. It definitely came in handy.

At work, I documented as much as I could as well on our Web Design & Services blog.

Dropping All of My Sites Into One Droplet?

I am paying DigitalOcean almost $40 a month for my two Droplets. This blog (visualgui.com) is hosted by one Droplet. The other Droplet hosts the following sites: donnytruong.com, hiepkieuky.com, prowebtype.com, simplexpression.com, and vietnamesetypography.com.

In my initial setup, I wanted my blog to have its own Droplet because it is powered by WordPress. All sites on the other Droplet are static, except for with a bit of PHP includes and a few minor PHP functions. Both Droplets are performing well. They have enough resources to power all sites. The only downside is that I have to update and upgrade both Droplets. I have been thinking of putting all sites into one Droplet.

If I could put all of my sites in one Droplet, I could potentially cut the month fee in half. I am not sure if the server has enough resources to power all these site as one. As a result, I have been thinking about it, but I have not consolidate all sites into one Droplet.

Anyone has experience with DigitalOcean, please let me know if I can drop all my sites into one Droplet.

Computers in Libraries 2025

At the last minute, I decided to attend the Computers in Libraries 2025 in Crystal City, Virginia. In the previous years, I came away disappointed and this year was even more. The web presence talks from previous years have been replaced with AI presentations.

I hadn’t followed up on AI as much as I should so I figured I would learn something. Unfortunately I didn’t find the IA talks to be useful. The speakers went through lists of AI tools for web design, marketing, social media, and on and on. Out of all the talks, I found one somewhat useful: “AWS & Cloud Computing: Server Management.” I asked the speaker if there’s an automated tool for upgrading the OS. His answer was not really. I am running two cloud instances for my personal sites on DigitalOcean’s Droplet and I am getting tired of having to upgrade them every few months.

Despite not finding these presentations too useful, I still attended to get out of work without taking personal days off. I just needed some escape from my home office as well as my work office for a few days. I am not sure if I will return next year. I wish there are other useful conferences around the Metro area. I don’t want to travel far. I need to start searching.

Is MODX the Best-Kept Secret of CMSes?

Last night, I upgraded the Law School website to MODX 3.1.0. With MODX Cloud hosting, making an upgrade was just a click of a button. Of course, I had to make a backup first and that was also a click of a button.

MODX has to be one of the most unappreciated content management systems. After working with other systems, both open source and proprietary, I appreciate MODX even more.

As a designer, I appreciate the freedom and flexibility MODX offers to create a unique experience without any compromise. I don’t need to rely on bloated frameworks or predetermined templates.

As a developer, I appreciate its powerful architecture to deliver a rich experience. Its reusable code keeps the content manageable. I reuse its code plenty of times to create dynamic content.

As a server administrator, I appreciate its cloud hosting service for a peace of mind. Since we switched to the cloud-based subscription, I no longer have to manage the server. From security to backup management to failover strategy, MODX takes care of everything.

The MODX support team is superb. I can reach out to them at any time and they would respond promptly. Obviously no one knows MODX better than the people behind the CMS.

After more than 15 years of using MODX, I still can’t figure out the reasons it is not widely adopted. I hope MODX continues to thrive even if it stays small.

My Base CSS Rules

/* Base Rules */

@viewport {width: device-width;}
:root {font-size: 100%;}

html {hanging-punctuation: first last;}

*, *::before, *::after {box-sizing: border-box;}

* {margin: 0; padding: 0;}

body { text-align: left;
font-kerning: normal;
font-variant-ligatures: common-ligatures contextual;
font-feature-settings: "kern", "liga", "clig", "calt","lnum";
}

h1, h2, h3, h4, h5, h6 {
overflow-wrap: break-word;
text-wrap: balance;
}

p {
overflow-wrap: break-word;
text-wrap: pretty;
}

pre {overflow-y: hidden; }

audio, canvas, embed, iframe, img, object, svg, video {
display: block; width: 100%; vertical-align: middle;
}

img {height: auto; }

ul, ol, dd, summary { margin: 0; padding: 0; }

nav ul, nav ol, aside ul { list-style: none; list-style-image: none; }

abbr {font-variant-caps: all-small-caps; text-decoration: none;}

input, button, textarea, select {
font: inherit;
letter-spacing: inherit;
word-spacing: inherit;
color: currentColor;
}

Pasting Text Without Format

In over 25 years of using computers, I had done countless copy and paste texts. Yet, I got annoyed with formatting every time I performed these two tasks.

Recently, I was helping Đán with his homework and I watched him copied and pasted text in to his assignments without the formatting.

He showed me how:

Win: Ctrl + Shift + V
Mac: Cmd + Shift + V

How in the world have I not known this all these years? Then again, better late than never. Thanks kiddo!

Upgraded to Ubuntu 24.04.1 LTS

After several failed attempts to upgrade Ubuntu 22.04 to 24.04.1 early this month, I was doing some research to migrate off DigitalOcean. My first choice for this WordPress-powered blog was WP Engine. After the controversy between WordPress and WP Engine unfolded, I was debating between WordPress.com and Pressable, both owned by Automattic. I still haven’t made up my mind.

I still don’t know where to move my PHP sites, which I put them all in one DigitalOcean’s Droplet. I don’t want to go back to shared hosting plans. I need a managed cloud hosting solution. I haven’t dug far enough. I was doing research on running my own server in my house, but that seems like a terrible idea. So I scrapped that.

I still don’t know what to do with the hosting for all of my sites, especially in the long run when I will no longer alive. I guess they should all evaporate with me. I shouldn’t even be thinking that far.

Today I tried to upgrade to Ubuntu 24.04.1 LTS again. Of course, I created snapshots before I did. To my surprise, the upgrade worked for both Droplets. It was a huge relief. I am going to stay with DigitalOcean for a bit longer. Maintaining Ubuntu keeps me up-to-date with backend development.

Running two Droplets costs me $35 a month. They are more than what I wanted to pay. I was thinking off combining all my sites into one Droplet, but I am not sure if that’s a good idea.

WordPress vs. WP Engine

In the last couple of days, I am following the battle between WordPress and WP Engine. On Wednesday Matt Mullenweg banned WP Engine from access WordPress.org. This ban has a huge impact on us. George Mason University hosts hundreds or even maybe thousands of is WordPress sites on WP Engine. The Scalia Law Sites, which powered by WordPress MultiSite, is also on WP Engine. I hope the issue will resolve quickly.

Need a New Home for My Sites

In the past few days, I tried to upgrade from Ubuntu 22.04 to 24.04 twice for two different Droplets, but both failed. The upgrades went through, but I could not restart the servers. I will try again when I have more time, but I need to look for a new home for all of my websites for the long run.

I like the cloud hosting services at DigitalOcean. They are fast, reliable, and easy to manage—until they are not anymore. Management the Droplets is also the downside. Every few months I have to do updates and upgrades. Minor security updates are fine, but a major upgrade is not. I don’t want to manage these servers anymore. I feel the same way Winnie felt when she finally decided to move from DigitalOcean to Opalstack.

I can’t go back to shared hosting. I need cloud hostings like DigitalOcean, but fully managed. I am considering WP Engine for this blog, but then I would need another home for five other sites. I am not in any rush. I still have a bit of time to make the decision. If you have any hosting recommendations, please let me know.

Contact