Jump to content

[SOLVED] using pages like. myweb.com/people/jon


jonshutt

Recommended Posts

I've seen a site which uses a URL like this one

myweb.com/people/jon

 

where the last word - jon, isn't actually a page, but it's a variable opened and used by the index.php file to create a personalised page. I'm having problems, firstly, if I type an address like that into my site, I get a 404 error becuase there is no file called simply 'jon'. I've tried creating a custom 404 page, but then i'm not sure how to read the word 'jon' out of the URL enter get it into php to load in custom information.

 

I thought about $_SERVER['PHP_SELF'] but that just said the current page was 404.php, I tried to find the refering page, but couldn't get this info.

 

Thanks

 

Jon

myweb.com/people/jon is usually something like, myweb.com/people.php?username=jon

 

this is done by creating an .htaccess file;

 

here's a quick reference: http://www.4webhelp.net/tutorials/misc/mod_rewrite.php

 

or: http://www.sitepoint.com/article/guide-url-rewriting/

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.