Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_action( 'init', function() {
$html_map = [
'howdy/world' => 'howdy',
];
$current_path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
if ( in_array( $current_path, array_keys( $html_map ), true ) ) {
$filename = $html_map[ $current_path ];
$contents = file_get_contents( __DIR__ . '/docs/' . $filename . '.html';
echo $contents;
exit;
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.