Hi everyone Just wondering how is it better to implement pretty urls in PHP projects.
What would be optimal or best way to make a feature in a CMS so people can choose if they want to use pretty urls or not.
Shall I use a function for each URL ?
define("BASE_URL", "http://www.someproject.com/"); define("REWRITE", true); # Array of url get params (parameter => value) $postView = array( "post" => "some-post-title" ); echo url(BASE_URL, "view.php", $postView, REWRITE);
And url() function will then build a url either like: http://www.someproject.com/view/post/some-post-title (if REWRITE is true) or http://www.someproject.com/view.php?post=some-post-title (if REWRITE is false)
Just interested what do you use? Maybe someone has got a lot of experience with this?
Thanks in advance
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.