Created
July 13, 2020 19:41
-
-
Save jamieparfet/dcc7105c32f144b2c03176939621720f to your computer and use it in GitHub Desktop.
Simple PHP server to redirect to specified location based on requested extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// php -S 0.0.0.0:8000 router.php | |
// http://host/x.jsp?u=http://example.com | |
if (preg_match('/\.(?:jsp)/', $_SERVER["REQUEST_URI"])) { | |
$location = $_GET['u']; | |
Header("Location: ".$location); | |
} else { | |
echo "error"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment