OK - sounds easy but here is detail. I would like to have several folders inside a main folder. Let's say an apps folder that will have several folders inside it which I want to be accessible using unique urls like example-Dot-com/apps/sdfsdfw435fdfsadf6af example-Dot-com/apps/dfasgklds9ef94brthg8 This thing is that I do not really want to have directory names like that but just virtually. Like the first app above will be in folder "my-first-app" and the second will be in "my-second-app" and so on... Please share your thoughts and suggestions to implement this using php? Thanks
you mean something like this RewriteEngine on RewriteRule ^apps/sdfsdfw435fdfsadf6af/*$ apps/my-first-app/$1 RewriteRule ^apps/dfasgklds9ef94brthg8/*$ apps/my-second-app/$1 Code (markup):
Somewhat. I just want the hashed/encrypted looking text to map on-to the real folders like my-first-app. The hashed/encrypted text value is to be generated dynamically from the database using some field values which I can use for mapping.
I'd suggest rewriting urls to one file, and then inside decide what to do: RewriteEngine on RewriteRule ^apps/(a-z0-9)/*$ apps.php?hash=$1 Code (markup): Otherwise you would have to generate .htaccess file every time you add new app to the database.
Yea, that looks more like it. But I have this query about "how"? I could write code to the app.php as you indicated above or even index.php in the app directory, but the question is how that hash is going to be linked back to the directory name which is in the form "my-first-app". This name is actually stored in the database or even the hash could be stored - I am ok with that. But the question is what should go inside the app.php file. I could get the hash and pull the data and match it from db and do some tricks to identity the real directory or in other words, map the hash to "my-first-app" in the php file but what next? Did you think I should "redirect" the url then to the actual directory name? Sorry, but I am not clear about "how" you suggested I should write the app.php file. Thanks