Solved

Direct subdirectory traffic to a php file

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article shows how a content item can be identified directly or through translation of a navigation type. It then shows how this information can be used to create a menu for further navigation.
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.

685 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