Goafer Posted February 10, 2009 Share Posted February 10, 2009 Hi there, i've recently been writing a pretty simple CMS. It works quite well and all the admin stuff works ie add/delete/edit pages. The bit that i'm struggling with the most is the front-end of the system. The menu system currently pulls all the "pageid's" and "titles" from the 'pages' table in the database and then makes a link for each one in a simple un-ordered list. The link for each one is a $_GET statement which points to "index.php?pageid=??". This works fine and the system runs okay however what i'm wondering: Can I easily disguise the content of the address bar so that it simply reads the name of the page. That is, if the user clicks the menu link for the 'about us' page, rather than having the address bar read "index.php?pageid=2" or "index.php?page=aboutus" I want it to read "exampledomain.com/aboutus" or "/aboutus.php". The theory being that the user then has a link that is more memorable and they can navigate back to the desired page rather than having to remember the more complex index.php?pageid=?? I hope that this is clear enough? Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/144639-solved-cms-address-bar-text/ Share on other sites More sharing options...
premiso Posted February 10, 2009 Share Posted February 10, 2009 You want to look into mod_rewrite using .htaccess if you are using an Apache server. Quote Link to comment https://forums.phpfreaks.com/topic/144639-solved-cms-address-bar-text/#findComment-758990 Share on other sites More sharing options...
Goafer Posted February 10, 2009 Author Share Posted February 10, 2009 Thanks very much Premiso. This looks like exactly what I need. I've taken a look at some pages on .htaccess and have loaded mod_rewrite on my Apache server and had a play with some simple rewrites. I think I will wait till I've finished the rest of the CMS and got it working properly before getting into the .htaccess stuff as I don't want to confuse myself too much. Thanks for such as speedy reply though. Quote Link to comment https://forums.phpfreaks.com/topic/144639-solved-cms-address-bar-text/#findComment-759053 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.