Grow your CSS skills. Land your dream job.

Thoughts and Help with “clean” URLs

  • # April 18, 2013 at 1:40 am

    I’m working on a project running on apache with php, mySql. It has a databse, but only for the products section, its not a CMS. I want this site to be “top-notch,” as it’s main purpose (aside from a small $$ gain) is to land me a job. (ps haven’t built a site in nearly 10 yrs)

    Currently, EVERYTHING runs through my main page. Everything gets included in there based off my query string. (this is how we did it, “back in the day”) At some point this site will be hosted on the clients server, which I can’t alter and don’t want to maintain. I’m giving them files …

    1) How much will clean URLs help my prospects of finding a Job with this site.

    2) How clean should/can I make them given I can’t screw with the server settings.

    3) How should I structure my files so I’m not always on the same page, but can still avoid duplicating code with my includes. (I can think of some ways, but looking for “best practices” type-answer)

    Here it is (thus far) if you’re curious: http://www.neighbordesign.com/catalog/lutherauctions.php

    # April 18, 2013 at 1:51 am

    Have a look at my cms with clean urls https://github.com/htmlmania/My-CMS

    # April 18, 2013 at 2:31 am

    Hey, thanks a lot. I’m digging in. Huge reply!

    # April 18, 2013 at 4:49 am

    Uploading a zip to github beats the purpose of version control I think.

    @GrimAndSarcastic , you sure honor your name :P

    There are a few topics here about rewriting url with .htaccess, and then including the proper page content php file based on request URI. I would go that way. URLs like `awesomeness.com?page=catalog` aren’t looking that professional, `awesomeness.com/catalog` is better, maybe you intend to fix that on production though… Yay, I am the shit!

    # April 18, 2013 at 8:26 am

    > 1) How much will clean URLs help my prospects of finding a Job with this site.

    I would say clean URLs are becoming expected. No-one would be surprised with you using them, but some might be surprised when you don’t.

    > 2) How clean should/can I make them given I can’t screw with the server settings.

    If you can upload .htaccess files, then as clean as you like.

    > 3) How should I structure my files so I’m not always on the same page, but can still avoid duplicating code with my includes. (I can think of some ways, but looking for “best practices” type-answer)

    I personally like to feed everything through index.php. Try to spot patterns in your work and ways of using generics. Try to use your database for anything that fits _within_ a pattern, and files for defining the pattern itself.

    As soon as you are using clean URLs, there is little advantage in maintaining different “starter” scripts. For example, why have home.php, products.php, etc, when index.php can simply load a home or products module along with their shared code.

    # April 19, 2013 at 8:36 pm

    Thanks guys. All the answers were helpful to me. I feel much more confident moving forward with my index.php layout. I now know I can still clean the URL and know how to do it. Awesome.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".