Question: How do you redirect a folder/directory to a file in PHP? For example, on reddit's website, if you type in reddit.com/r/ it redirects to reddit.com/subreddits

How do you redirect a folder/directory to a file in PHP? For example, on reddit's website, if you type in reddit.com/r/ it redirects to reddit.com/subreddits instead. I know the header function is used but I don't know how to check if the user requested to go to reddit.com/r/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!