I've seen various URL shortening sites which shorten a URL to something like:
http://something.com/WWER3
The missing element from what I would c开发者_JAVA百科all a normal URL is the file name and file extension. (the WWER3 is the variable that tells the loaded page where to forward the viewer onto)
What is the best practise for loading a 'forwarding' page without showing a file name or extension? I assume this is all IIS, is it a modified 404 page or something else?
Thanks
Something else.
The is something you can achieve using a htaccess file, the last part of the URL is mapped to a variable which is then read, have a look for htaccess URL rewriting - http://www.webdeveloper.com/forum/showthread.php?t=214577
URL Shortening services like TinyURL usually store a has along with the content. This hash is an identifier and points to the content that should be retrieved and served to the client. There are many hashing algorithms that can be used. One could also use the record id if they liked but a hash of the id or a hash of the first x number of file characters and the record id would result in a better scheme. This can be done on any web server that supports cgi or language parser/interpreter modules, i.e. 99% or http servers. The htaccess file would not be suitible if you want to handle hundreds of files or more. It would grow so large that it would slow down the server load and perhaps response time. It would also be a nightmare to manage.
精彩评论