Superian Posted May 18, 2008 Share Posted May 18, 2008 I am building an custom Content Management System, and I am not sure of the correct file structure that a CMS should have. Maybe you all could give me some ideas that I can benefit from. Below is an idea of the file structure that I am using. <dir> blog index.php <dir> images <dir> style Every file has an index.php in it, but the index.php is included inside of page.php. Blog is being pulled from the database. The URL looks something like the following: http://localhost/page.php?content=blog page.php <?php define('PAGE_FILE', true); require_once("include_fns.php"); if (isset($content) && $content == $_REQUEST['content']) { include("$content/index.php"); } else { header("Location: index.php"); } ?> index.php inside of the blog <DIR> <?php <?php session_start(); if (!defined('PAGE_FILE')) { header("Location: http://localhost/index.php"); exit; } ?> Any ideas on how I could improve my file structure because there are a lot of pages that I am going to implement. Quote Link to comment https://forums.phpfreaks.com/topic/106208-correct-way-to-implement-a-cms/ Share on other sites More sharing options...
resago Posted May 18, 2008 Share Posted May 18, 2008 search engines will hate you. Quote Link to comment https://forums.phpfreaks.com/topic/106208-correct-way-to-implement-a-cms/#findComment-544473 Share on other sites More sharing options...
Superian Posted May 19, 2008 Author Share Posted May 19, 2008 search engines will hate you. Why is that? What is it that I am doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/106208-correct-way-to-implement-a-cms/#findComment-544707 Share on other sites More sharing options...
DarkWater Posted May 19, 2008 Share Posted May 19, 2008 Use mod_rewrite to make SEO-friendly URLs. =P Same functionality, easier URLs. Quote Link to comment https://forums.phpfreaks.com/topic/106208-correct-way-to-implement-a-cms/#findComment-544729 Share on other sites More sharing options...
MadTechie Posted May 19, 2008 Share Posted May 19, 2008 most search engines handle these quite well now days, but for some of the older ones it might be an idea to add a mod rewrite Quote Link to comment https://forums.phpfreaks.com/topic/106208-correct-way-to-implement-a-cms/#findComment-544773 Share on other sites More sharing options...
Superian Posted May 19, 2008 Author Share Posted May 19, 2008 most search engines handle these quite well now days, but for some of the older ones it might be an idea to add a mod rewrite My mod_rewrite is not working! What am I doing wrong? RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/\.]+)/?$ /page.php?content=$1 Quote Link to comment https://forums.phpfreaks.com/topic/106208-correct-way-to-implement-a-cms/#findComment-544807 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.