SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,675
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best practice... you views on this approach.

    Hi all

    I had a previous post in another category http://www.sitepoint.com/forums/show...ter-URL-change

    The above went unanswered which brings here.
    I have a general rewrite that works ok and have a indexed page.php I need to add extra content to this page page/more-content which for the time being can't have the extension removed. .php in this case.

    What are the concerns and is it ok to have the pages structured like this?

    page.php
    page/more-content
    page/some-more-content
    page/some-more-content-content

    and so on...

    I won't be rewriting page.php what I mean is I won't be linking to /page
    This is my main worry because I'll be serving content without the file extension to other pages.

    Hope this makes sense, thanks.
    The more you learn.... the more you learn there is more to learn.

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    cb,

    I avoid this sort of thing like the plague but, if you want to pursue it, you'll need Options +MultiViews which will examine the directories in the path and serve a file despite the extension not being specified. Of course, page.php will have to deal with the $_SERVER['REQUEST_URI'] whether it contains/requests any more content.

    The downside I've seen from members in the past is that they use the same name for a subdirectory as a filename and wonder why the requested file (in the subdirectory) isn't being served. If you're better organized than the other members (and me, too!), they you should be okay.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,675
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I avoid this sort of thing like the plague
    Just what I thought DK. This is certainly not the the way to go, can't seem to find a better alternative unless I create new pages which basically defeats the object. Regarding SEO, DRY anyway and generally the overall content flow. It does make me laugh all the messing about because of a facebook like.

    I'll have to reassess the issue, maybe I'll get a response to my other thread
    Even if it does work I'll know this approach is wrong, like writing messy code DK its not acceptable and kind of goes against everything I've learned.

    Thanks for the feedback
    The more you learn.... the more you learn there is more to learn.

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    cb,

    That was my take on MultiViews ... but the simple fact that it exists means that someone must like it. At least I attempted to let you know what to look for if you decide to use it after all.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2005
    Posts
    1,675
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi dk

    I've never used MultiViews before and have no idea where to start. That's the main reason I excluded this and didn't give it much praise.
    Are you saying this will be ok?
    Seems like this will be the only way I can do it. I've had to put things on hold regarding new content.

    Do you have any good simply resources at hand for the MultiViews or can you explain the best way?

    Cheers, cb
    The more you learn.... the more you learn there is more to learn.

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    cb,

    Apache.org is always the best place for Apache information: mod_negotiation's MultiViews will have the information you are seeking. If it's available there, I'm sure that someone has a good reason to use it but ...

    As for me, my STRONG bias is to use Options -MultiViews so I don't have file/directory naming problems and advise others to avoid it, too.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •