Skip to content

Instantly share code, notes, and snippets.

@geigel
geigel / gist:804d7005dd587c6bd4fa565c41cc3f62
Last active April 3, 2025 20:15
Regular expression (regex) matching every page in a Wordpress site except for the homepage and pages related to the admin section (e.g. those under wp-admin/). Useful when redirecting to the homepage of a dead site that needs to still exist, but force all incoming traffic to the homepage to see some message.
^(?!\/(wp-admin\/|wp-login\.php|wp-register\.php)(\?|$)).+$