htmonitor

.htaccess Geo-Redirection Monitor

A real-time terminal UI application built with Go that monitors .htaccess file changes and automatically tests geo-redirection rules.

Features

Installation

go mod tidy
go build -o htaccess-monitor main.go

Usage

# Run the monitor
go run main.go

# Or use the built binary
./htaccess-monitor

The monitor can watch links.testing and .htaccess and automatically re-run link tests whenever either file changes.

Run (from repo root)

make go-test-watch

Run (direct)

cd apps/htaccess-monitor
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
  go run main.go -test ../../links.testing -watch

Controls

CSV format (links.testing)

Agent, Country, URL, Expected status, Expected result
Browser, US, http://localhost:8080/ , 200, No redirect
Googlebot, UK, http://localhost:8080/ , 200, No redirect
Browser, FR, http://localhost:8080/uk , 301, http://localhost:8080/uk/

Notes:

Controls

Dependencies