I did some looking around at how other sites might handle this and didn't really see anything that jumped out at me. I'm working on a project where you can create pages that get linked to from every other page. Here is where the issue is coming up for me.
I'm not sure how I should go about linking to these pages. I've only really thought of two ideas, them being:
website.com/page/My-Page-Name
website.com/My-Page-Name
To note, I'm using mod_rewrite to redirect them to a file that takes the page name as a parameter and grabs all the relevant info from the DB and displays it. This is where an issue develops for idea #2.
Idea #1 works and is solid, but I think it's kind of ugly and you don't see a lot of websites that link to other pages of the site with other information padded in the URL.
EDIT for a bit of clarity. The intention of said pages are to be static in the sense they will only ever display what the user sets them to display. They will never except any sort of data in which case pages formatted like in this example would be more appropriate. I'd compare these page more so towards SO's faqs or about page which don't have URLs formatted in this manner.
Idea #2 looks cleaner but runs into some issues when using mod_rewrite and creating said pages.
There are other parts of the site that are linked to that could be mimicked and cause conflicts if you named the page the same. For example, website.com/page1/
points to page1 which already exists, but a conflict would arise if someone wanted to create a page called page1.
So implementing this idea I'd have to filter and limit the user in what page names they could use and at the same time this could make the feature a bit unintuitive and leave them scratching their head. As well as it seems a bit ugly coding it, having an array of unacceptable page names and having to check against it.
The last bit dealing with mod_rewrite to redirect to something like that: RewriteRule ^([A-Za-z0-9-]+)$ getPage.php?p=$1
gets a bit ugly as it gets a bit greedy even while limiting what it'll except.
So does anyone have any insight on any other possible methods to tackle this issue with or how the implementation of one of the two mentioned could be different / better?
Thanks.