gorgo666 Posted July 23, 2008 Share Posted July 23, 2008 Hello everyone. I've beenputting off joining phpfreaks for a lonnggg time but here I am, finally! But anyway. I have a question that I've been pondering for ages, and it may be a little obvious so please don't ridicule me. Most websites now-a-days seem to have completely removed file names from their addresses and navigation. To give you an example, a lot of people may have used http://www.acme.com/about.php but now instead you only see http://www.acme.com/about/ which obviously refers to a directory. It looks much tidier and is really Web 2.0... Can someone elaborate on this? Is it a behind the scenes CMS doing this, like Drupal or Wordpress? Or is it simply people storing an index.php file inside that directory? I look forward to any reply! Cheers guys. Link to comment https://forums.phpfreaks.com/topic/116194-tidy-and-modern-web-address-question/ Share on other sites More sharing options...
Xurion Posted July 23, 2008 Share Posted July 23, 2008 Most likely it is done with a .htaccess file. This 'rewrites' URLS to be more user friendly. Link to comment https://forums.phpfreaks.com/topic/116194-tidy-and-modern-web-address-question/#findComment-597519 Share on other sites More sharing options...
JasonLewis Posted July 23, 2008 Share Posted July 23, 2008 This was just a double post by the OP. Read the other one, perhaps a moderator can lock/remove this one. Link to comment https://forums.phpfreaks.com/topic/116194-tidy-and-modern-web-address-question/#findComment-597523 Share on other sites More sharing options...
craygo Posted July 23, 2008 Share Posted July 23, 2008 It can also be a script which seperates the url into parts then includes a certain part of the url as a page. example You start of in www.acme.com/index.php. on that page you have a link which goes to www.acme.com/about. At the top of index.php you have something like this <?php $uri_split = explode("/", $_SERVER['REQUEST_URI']); $tmp = array(); foreach($uri_split as $key => $val) { if(!empty($val) || $val != "") { $tmp[count($tmp)] = $val; } } $uri_split = $tmp; if(!isset($uri_split[0])) { $uri_split[0] = "about_us"; }?> Now you just include the page in index.php include($uri_split[0]); hope I got that right. Just grabs bits from one of my scirpt. Ray Link to comment https://forums.phpfreaks.com/topic/116194-tidy-and-modern-web-address-question/#findComment-597529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.