Forum Moderators: phranque
a) Having the application write the tiny url to .htaccess would obviously lead to 1000's of lines in the long term. Would this cause any performance issues ? I'm guessing this may not be a good option.
b) Redirect the short url as a query parameter for example: http://example.com/shorturlid must be converted and redirected by Apache to http://example.com/short.php?id=shorturlid so that the application can do the real redirect. If this is a better option what should be the redirect rule in Apache htaccess ? (to convert URL from http://example.com/shorturlid to the form http://example.com/short.php?id=shorturlid )
Any help in this matter is sincerely appreciated.
Create a folder under the root domain (doc root)with the "shorturlid" named folder and create a .htaccess file with the following rule:
Options +FollowSymLinks
RewriteEngine on
redirectMatch permanent /shorturl/shorturlid [longurldestination.com...]
Is this is a good practice ? Would there be any performance issues ?