jkewlo Posted March 20, 2008 Share Posted March 20, 2008 how would you go about doing a site with no index.php instead have it so that the url post links like ?page=login ?page=play ?page=register etc... good for me to know and others Link to comment https://forums.phpfreaks.com/topic/97168-page/ Share on other sites More sharing options...
Northern Flame Posted March 20, 2008 Share Posted March 20, 2008 do you mean something like http://www.website.com/?page=home if so, in your index.php page make your file include certain files depending on which page is called through $_GET['page'] Link to comment https://forums.phpfreaks.com/topic/97168-page/#findComment-497216 Share on other sites More sharing options...
jkewlo Posted March 20, 2008 Author Share Posted March 20, 2008 ahh so it would be like if($page == loging){ include login.php? } Link to comment https://forums.phpfreaks.com/topic/97168-page/#findComment-497218 Share on other sites More sharing options...
Northern Flame Posted March 21, 2008 Share Posted March 21, 2008 ahh so it would be like if($page == loging){ include login.php? } it would be more like <?php $page = $_GET['page']; if($page == 'loging'){ include('login.php'); } ?> Link to comment https://forums.phpfreaks.com/topic/97168-page/#findComment-497666 Share on other sites More sharing options...
mb81 Posted March 21, 2008 Share Posted March 21, 2008 We use an .htaccess file and a very simple rewrite to create different pages from one file: RewriteEngine On RewriteRule ^([a-z0-9]+)$ content.php?id=$1 [L] This also helps us with search engine optimization, because the pages will index, because the urls are like this: http://www.mysite.com/page http://www.mysite.com/anotherpage instead of like this: http://www.mysite.com/content.php?id=page Crawlers will ignore the parameters (everything after the ?), so the only page that gets indexed is the default page. Link to comment https://forums.phpfreaks.com/topic/97168-page/#findComment-497726 Share on other sites More sharing options...
BlueSkyIS Posted March 21, 2008 Share Posted March 21, 2008 "Crawlers will ignore the parameters (everything after the ?), so the only page that gets indexed is the default page." Incorrect. Not that it's a bad idea to optimize your URLs as described, but I've got hundreds of ?=blahblah pages indexed in all search engines. Link to comment https://forums.phpfreaks.com/topic/97168-page/#findComment-497732 Share on other sites More sharing options...
Northern Flame Posted March 21, 2008 Share Posted March 21, 2008 "Crawlers will ignore the parameters (everything after the ?), so the only page that gets indexed is the default page." Incorrect. Not that it's a bad idea to optimize your URLs as described, but I've got hundreds of ?=blahblah pages indexed in all search engines. yea i agree with BlueSkyIS, not all search engines ignore that, some do, but the major ones like google and yahoo dont Link to comment https://forums.phpfreaks.com/topic/97168-page/#findComment-497876 Share on other sites More sharing options...
jkewlo Posted March 22, 2008 Author Share Posted March 22, 2008 ahh so it would be like if($page == loging){ include login.php? } so i will need to do this in index and have my pages jump from that it would be more like <?php $page = $_GET['page']; if($page == 'loging'){ include('login.php'); } ?> Link to comment https://forums.phpfreaks.com/topic/97168-page/#findComment-497985 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.