Solved

Direct subdirectory traffic to a php file

Posted on 2014-01-31
1
223 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

776 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