jonshutt Posted April 3, 2009 Share Posted April 3, 2009 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 Link to comment https://forums.phpfreaks.com/topic/152326-solved-using-pages-like-mywebcompeoplejon/ Share on other sites More sharing options...
mrMarcus Posted April 3, 2009 Share Posted April 3, 2009 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/ Link to comment https://forums.phpfreaks.com/topic/152326-solved-using-pages-like-mywebcompeoplejon/#findComment-799983 Share on other sites More sharing options...
jonshutt Posted April 3, 2009 Author Share Posted April 3, 2009 thanks - that's something new I never understood. a good example of 'the hardest part of finding the answer is knowing what to ask for' Link to comment https://forums.phpfreaks.com/topic/152326-solved-using-pages-like-mywebcompeoplejon/#findComment-800026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.