Go Back   SitePoint Forums > Forum Index > Host Your Site > Apache Configuration
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Feb 28, 2004, 22:07   #1
monty
SitePoint Zealot
 
Join Date: Jun 2003
Location: New York City
Posts: 117
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?
monty is offline   Reply With Quote
Old Feb 28, 2004, 22:30   #2
lo0ol
l º 0 º l
silver trophybronze trophy
 
lo0ol's Avatar
 
Join Date: Aug 2002
Location: Palo Alto
Posts: 5,398
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.
__________________
.
Zach Holman
good-tutorialsblogtwitterlast.fm
lo0ol is offline   Reply With Quote
Old Mar 2, 2004, 04:24   #3
mmj
Test cases complete. 0 fails.
 
mmj's Avatar
 
Join Date: Feb 2001
Location: Melbourne Australia
Posts: 6,568
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 momentous journey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Spuds Jokes Bazaar VCS Inkscape Firefox phpBB
mmj is online now   Reply With Quote
Old Mar 2, 2004, 06:31   #4
Rynoguill
minister of propaganda
silver trophy
 
Rynoguill's Avatar
 
Join Date: Feb 2004
Location: Midsouth
Posts: 1,399
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
Rynoguill is offline   Reply With Quote
Old Mar 3, 2004, 17:13   #5
Owen
Hi there!
 
Owen's Avatar
 
Join Date: Jan 2000
Location: CA
Posts: 1,165
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
__________________
OP-DESIGN
Owen is offline   Reply With Quote
Old Mar 3, 2004, 22:58   #6
pippo
FreeBSD The Power to Serve
silver trophy
 
pippo's Avatar
 
Join Date: Jul 2001
Location: Italy
Posts: 4,568
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
pippo is offline   Reply With Quote
Old Mar 3, 2004, 23:04   #7
mmj
Test cases complete. 0 fails.
 
mmj's Avatar
 
Join Date: Feb 2001
Location: Melbourne Australia
Posts: 6,568
Yes, multiviews is the most convenient way to do this, because it does it automatically. Otherwise you must have "vary" files.
__________________
[mmj] My momentous journey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Spuds Jokes Bazaar VCS Inkscape Firefox phpBB
mmj is online now   Reply With Quote
Old Mar 4, 2004, 07:19   #8
Rynoguill
minister of propaganda
silver trophy
 
Rynoguill's Avatar
 
Join Date: Feb 2004
Location: Midsouth
Posts: 1,399
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
Rynoguill is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

 
Forum Jump


All times are GMT -7. The time now is 21:12.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved