Jump to content

Archived

This topic is now archived and is closed to further replies.

fubowl

Combining SE friendly URL structure with content management

Recommended Posts

I would just like to throw this out there to see if anybody can help my search. I have yet to field either a CMS or a tutorial that can show me how to combine these two.

I've seen some CMS's that support the friendly URL's but I would like the entire structure to be defined within.

A complete "virtual site structure". No pages, except the neccessary code of course, everything else contained within the db. So I could just add [a href=\"http://mysite.com/hello/world\" target=\"_blank\"]http://mysite.com/hello/world[/a] and then be able to create pages within that directory.

I'm also trying to find a way of managing this structure as easily and efficient as possible since I know that each time a page would be accessed the recursion would yield a lot of queries.

Thanks in advance.

Share this post


Link to post
Share on other sites
You can use mod_rewrite (search for it in google) in any CMS. Just make the links

domain.com/page/1234/page-name-here/

redirect to

domain.com/page.php?ID=1234

Share this post


Link to post
Share on other sites
Don't know if this is what you mean but it could be this.

You would need a table, say called pages, with an id, title, text for example. If you would need to group pages into categories add a category_id field and a categories table to match.

You could use tinymce for the editor to help the cms users edit the text in each page.

Then to access an individual page you could do it like this www.domain.com/1/1/ which mapped to index.php?category=1&page=1 (by Apache's mod_rewrite) would then give you the page (just fetch the row from the database).

Of course, if you would like to use the category name and page title, just use those instead of the id numbers. So, this
www.domain.com/categoryname/pagetitle/
would map to this
index.php?category=categoryname&page=pagetitle

You would then have to make sure that there isn't more than 1 page with the same title in each category.

Just my quick thoughts. Hope it helps.

Best,

Sofia

Share this post


Link to post
Share on other sites
Thank you for your help, but I was being very unclear which I apologize for.

Here is a more refined question directed towards this mean.

How would I go about matching a string, such as [a href=\"http://mysite.com/category1/subcat2/subsubcat3/my-article-on-something.html\" target=\"_blank\"]http://mysite.com/category1/subcat2/subsub...-something.html[/a] with it's proper entry in a Db based hierarchy. I guess that is what I'm really trying to get at. I have no idea how I could go about looping through parent/child relationships or once i break the url into an array, how i could go about getting a specific entry via this manner.

If you have any experience with this, I would greatly appreciate the help. I'm pretty new with all this and am still trying to get oriented, so any help on the way to setup the table and the neccessary code would be helpful.

Thanks.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.