Trevis Rothwell's weblog

Almost, but not quite, entirely unlike tea

Abstract URLs with Apache .htaccess files

03 April 2021

I moved my web pages to a new server, but neglected to copy my Apache .htaccess files. For WordPress, no problem, since the WordPress software itself reminds you of what .htaccess content you need. But for generic abstract URLs, such as letting users request www.example.com/foo and serve them www.example.com/foo.html, what do you do?

After several attempts, I found, as usual, the answer at Stackoverflow:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule (.*) $1.html [L]

Are Books Worth It?

04 January 2020

There was an interesting discussion thread on Hacker News today, on the subject of the value of reading books.

The proposed premise was that, essentially all information must be freely available on the world wide web, right? Is it still worth it to read books? Or can you just scour blogs and tweets to find anything you want to know?

My own personal book-reading time has waxed and waned over the years; I would readily and heartily agree that I get more enjoyment and satisfaction out of reading a book than I do out of most web browsing, but web browsing is easier, and it at least superficially feels like I am reading and learning.

The Hacker News thread includes many insightful comments. One that I found especially valuable is from user ivan_ah:

The way I see it, non-fiction books are all about distillation of information. Yes most of the information from books is freely available online in some other form, but you’ll have to dig for it in many places, and learn from many narrators.

The benefit of the book-length information product is that a single author went through all the possible sources and used their expertise to give a coherent story on a subject. You can think of the book as someone who read 100 blog posts for you and extracted the useful info from them.

As a learner, I have found this to be true. Last year, for example, I was learning to use the VueJS Javascript framework. There is a great wealth of information in blog posts. Now, as an experienced VueJS user, I can read an individual blog post and get an answer to a specific question. But when learning the framework initially, I found it beneficial to read a book, to have that “coherent story” rather than a bunch of discrete chunks of information.

This should also be an encouraging thought as a writer. It can be easy to talk yourself out of writing a book on a subject because everything that you know about it, you learned from someone else! That whole sum of knowledge is already out there on the web! But you can nevertheless distill your own coherent story into book form, and produce a beneficial educational experience.