Solved

Direct subdirectory traffic to a php file

Posted on 2014-01-31
1
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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.
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
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decadeā€¦

738 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