Avatar of Bruce Gust
Bruce GustFlag for United States of America asked on

A file as a directory

I want to provide my users with an easy URL that connects them to a specific file.

What I've got in mind would be something like "http://www.myserver.com/their_id_number."

So, if the URL, using the format I'm envisioning, looked like this: http://www.brucegust.com/12345 then it would direct the user to the appropriate page where I'm grabbing the id number and doing the necessary coding to provide them with the info I want to communicate.

I've got over 60,000 ids, so that number of folders isn't practical, but it seems I've seen what I'm trying to do. My question is: How? How do you set up your server in such a way where you have the capacity to do what I'm attempting?

Thoughts?
PHPHTMLJavaScript

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
strivoli

I would create a 2 level tree:
a. 1st level with 600 folders,
b. 2nd level with 100 folders,

The total will be 600*100=60,000 ids.
SOLUTION
gr8gonzo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
Bruce Gust

What I'll do is use a hex key to prevent ids from being exposed, but now, here's my question:

I'll turn on the Rewrite Engine, but then how do I configure it so it only kicks on when there's an id? My concern is that the way I have it in my head right now, any valid address after the slash is going to be processed as a rewrite and I don't want that.

So...

brucegust.com/qr/index.php?id=12345 needs to be...
brucegust.com/12345

RewriteEngine On
RewriteRule /

How do I structure my RewriteRule?
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy