SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    New York City
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow URL Uniformity: How much must they conform?

    I'm setting up my site to use friendlier URLs like this:

    site.com/article/name_of_topic

    article will actually be a PHP file. However, in addition to template pages like article, I have a lot of non-template PHP pages on my site, such as terms.php, about.php, privacy.php, etc.

    If I am to maintain URL unformity on my site, then the URL to reach the terms.php page on my site should be site.com/terms instead of site.com/terms.php. Right? But this would require that I add the following to my .htaccess file for every single PHP file on my site so that I don't have to include the ".php" after the page name:

    <Files terms>
    ForceType application/x-httpd-php
    </Files>

    This seems a bit overkill, especially for pages that are mostly static and that don't really need to be indexed by a search engine. I could end up having a long list of <Files> elements in my .htaccess file if I have to do this for every page on my site.

    Is it more important to maintain URL uniformity on a site, or is it acceptable to use a mix of both: site.com/article/name_of_topic for articles, and site.com/terms.php for Terms (or any other mostly-static page)? Is there an "industry standard" for something like this?

  2. #2
    l 0 l silver trophybronze trophy lo0ol's Avatar
    Join Date
    Aug 2002
    Location
    Palo Alto
    Posts
    5,329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't seen a sort of standard or anything. I actually do the combination method myself- I use friendly folder URLs plus regular page.php pages. Honestly, I don't think that matters too much to have your URLs exactly alike. Like you were talking about- they're kinda two different things: static and dynamic pages. I don't think static pages warrant a whole lot of modifications to your .htaccess. So no, I think you'll be fine the way you have it.

  3. #3
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Have a look at the 'Cool URIs' link in my signature, under How can I remove the file extensions.... You can set up Apache to do content-negotiation for you so that if somebody asks for http://www.example.com/terms, Apache will automatically search for the best match (and would find terms.php).

    SitePoint does exactly this. For example,

    http://www.sitepoint.com/blogs.php
    http://www.sitepoint.com/blogs

    Script filename is blogs.php
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  4. #4
    minister of propaganda silver trophy Rynoguill's Avatar
    Join Date
    Feb 2004
    Location
    Midsouth
    Posts
    1,373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mmj
    Have a look at the 'Cool URIs' link in my signature, under How can I remove the file extensions...
    i know this is the apache forum, but does anyone know if this is possible with IIS?
    rynoguill
    Ryan Guill, AKA Mark Roman

  5. #5
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not?

    <FilesMatch "^(gif|png)">
    ForceType application/x-httpd-php
    </Files>

    (I think. My regexp is a little rusty. It should match everything except gif and png extensions.)

    Or the directory directive? http://httpd.apache.org/docs/mod/core.html#directory

    What I did on one site is name everything .go. Then set apache up to parse .go files like .php.

    But as said earlier, there's nothing wrong w/ .php files in Google's eye.

    Owen

  6. #6
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tom,
    > you can set up Apache to do content-negotiation
    > for you so that if somebody asks
    Did you use the MultiViews option ?
    Under .htaccess ?


    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  7. #7
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, multiviews is the most convenient way to do this, because it does it automatically. Otherwise you must have "vary" files.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  8. #8
    minister of propaganda silver trophy Rynoguill's Avatar
    Join Date
    Feb 2004
    Location
    Midsouth
    Posts
    1,373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Rynoguill
    i know this is the apache forum, but does anyone know if this is possible with IIS?
    does no one know about doing this with iis? or should i reask in another forum?
    rynoguill
    Ryan Guill, AKA Mark Roman


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
  •