Jump to content

Recommended Posts

Hi,

 

I would like to have a script that captures an extension after my domain URL and puts it in a variable which I can later use to redirect the page...

 

For example... if someone types

www.mydomain.com/johnsmith

and there is no such folder as 'johnsmith', instead of displaying en error page, the script takes the string johnsmith and puts it in the variable $sample so I can match it off with a number of records in the database and then redirect, for example.

 

I'm sure this exists somewhere so any help would be great...

 

Cheeeeeeers in advance

Ed Kellett

Link to comment
https://forums.phpfreaks.com/topic/151265-url-redirect/
Share on other sites

Thanks for your reply...

The thing is the actual file doesn't exist...

 

A bit more info on what I am doing so that you might be able to help...

 

I am building a directory of businesses... people sign up and have a listing on the site...

so far so good...

 

but I would like to be able to give them their own URL... like myspace do (myspace.com/samplename)...

 

For example someone signs up and their name automatically generates a URL that they can put on their business cards etc...like www.directory.net/samplename

 

Do you get me?

 

So scanning for folders in the site won't do it because there won't actually be a folder... when they type in www.directory.net/samplename I need a way that php takes the string 'samplename' and scans the database to find an entry in there that matches... and if it finds a match redirects to that detail page...

 

Thanks so much for your help...

 

Ed

 

 

Link to comment
https://forums.phpfreaks.com/topic/151265-url-redirect/#findComment-795071
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.