Solved

Direct subdirectory traffic to a php file

Posted on 2014-01-31
1
220 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
ID: 39823750
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
This article will shed light on the latest trends when it comes to your resume building needs. For far too long, the traditional CV format has monopolized the recruitment market.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

11 Experts available now in Live!

Get 1:1 Help Now