Bill
Bill

Reputation: 19268

PHP CMS web page short URL?

I am buildiig a simple CMS and would like to know how to create short URLs (not the APACHE bit but the PHP bit).

example.com/?page=100

example.com/home/test

How would I interpret the ?page=100 into /home/test (Through select the database, but i couldn't figure out how) I can see if just one level /home/test because you probably can have a zoneID, but when it comes to /home/test/test. I become lost

And how do I parse back the /home/test to the page id.

Plus is there anyone can show a bit idea for the database design as well?

Upvotes: 0

Views: 413

Answers (3)

marabooy
marabooy

Reputation: 11

ok i think you need to definitely need to look at the way you are going to do your routing (through mod_rewrite)..for example 1.you can rewrite the page www.example.com/test to ..www.example.com/index.php?page=test and implement a way of getting page by the page name..and returning an id if a page name exists ..if multiple entries exist then maybe the last modified will be given precedence over the otheers ..you can get the following book CMS Design Using PHP and jQuery helped me alot

Upvotes: 0

nkuhta
nkuhta

Reputation: 11128

You need some kind of mod_rewrite for your server side. That will help you to send route data to index.php (or somewhere else) file without filename in adress string. Than some php file will analyze the route and give correct html.

Upvotes: 0

Related Questions