I am working on a CMS of my own at http://html-mania.co.uk/stuff/confadarte-bikini-styles/
I would like to make wordpress like URLs for it and i know the htaccsess part but im wondering how the PHP works.
Could you maybe give me some starting code and ill try to do the rest.
@htmlmainiac Yeah, it’s best to have a little patience in the forum.
“I want WordPress (pretty) URL’s” is not really anything to go on. We don’t know how your site’s URL’s are structured since you don’t really have any pages up except “Home” and “About”. If that is the way it will be, removing the .php extension is what I suggested above.
There are lots of ways of achieving what you want to achieve. The first is to use .htaccess to rewrite everything to index.php (except the files you want a user to access directly). You can then use something like:
To determine their perceived URI and act upon it (remember to preserve GET request parameters).
An alternative method, if you have a consistent and predictable structure, is to act on the URL in .htaccess to turn the URI into GET parameters. For example, Zend URLs have a very strict format:
This means .htaccess can (if you want) split those components and formulate a GET request, rewriting (again) to index.php.
However, creating a CMS is a big task. I assume you are using it as a learning experience. Unless you specifically want to learn how to construct these sorts of module, I would focus on more fundamental components first. Ugly URLs don’t make your system unusable and are best addressed at or near the end, once you know the sort of information your URLs will contain.
Sorry — you posted while I replied.
> This is all about php now not htaccess
You don’t seem to realise how these are connected. As I allude to above, parts of this process can be done by either. It is down to you as to which you want to use.
Personally I favour .htaccess doing a minimal amount of work, as I think it is easier to preserve backwards compatability that way. However, if you take a look at http://camendesign.com (look at both his php and .htaccess source) you will see that he uses .htaccess heavily in his rewrites.
Compare Kroc’s .htaccess file with that of Kirby, for example:
If you ignore the comments, it’s only 13 lines (2 of which can be omitted on many servers because he’s covering himself in case mod_rewrite isn’t available).
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".