A real-time terminal UI application built with Go that monitors .htaccess file changes and automatically tests geo-redirection rules.
.htaccess file changesgo mod tidy
go build -o htaccess-monitor main.go
# 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.
make go-test-watch
cd apps/htaccess-monitor
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
go run main.go -test ../../links.testing -watch
f – Toggle hide failsh – Toggle hide passesq – QuitAgent, 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:
Agent supports Browser or Googlebot.GB for the X-Test-Country header.Expected result should be contained in the Location response header.r - Run tests manuallyq - Quit application