Forum Discussion
How can I use dynamic paths that all load the same file?
Install the URL Rewrite module then go into the IIS Management application. Click the website in question. Open URL Rewrite. Create a new rule.
Requested URL: Does not match the pattern
Using: Regular expressions
Pattern: \/(?!.*index|$)
Ignore case: true
Action: Rewrite
Rewrite URL: index.php?tk=1
Append query string: true
Stop processing of subsequent rules: true
This assumes you use index.php as your script file. If you use default.php, just change the index to default in the regex. If you had this as your index.php:
<?php
echo array_key_exists("REQUEST_URI", $_SERVER) ? $_SERVER["REQUEST_URI"] : "No URI";
?>
then you went to https://www.mydomain/com/whatever, you would get this output:
/whatever
Which you can then use to query the database for the appropriate URL to push. In my rewrite URL example I did index.php?tk=1 so you can look for $_REQUEST["tk"] to know this is an attempt to do a saved URL, not simply normal use of the site. Obv change that to whatever "fingerprint" format you wish.