Solved

Direct subdirectory traffic to a php file

Posted on 2014-01-31
1
214 Views
Last Modified: 2014-01-31
Hi

I am developing a members database system.

I want people to be able to go to their page e.g.

www.domain.com/matthew or www.domain.com/james - but I don't want to create each individual subdirectory - rather have some method whereby for example a 404 page would check and re-direct to a script which would be something like page.php?name=matthew if the request was to www.domain.com/matthew

Any ideas?
0
Comment
Question by:wilkesco
1 Comment
 

Accepted Solution

by:
wilkesco earned 0 total points
Comment Utility
Don't worry - I've sorted it..

.htaccess in the root:
ErrorDocument 404 "/redirect.php"

... then redirect.php:
$subdir = substr($_SERVER['REQUEST_URI'],1);

($subdir will contain a string of the sub-directory)

Thanks anyway

Matt
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now