|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Zealot
![]() ![]() Join Date: Jun 2003
Location: New York City
Posts: 117
|
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 |
|
l º 0 º l
![]() ![]() 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.
![]() |
|
|
|
|
|
#3 |
|
Test cases complete. 0 fails.
![]() 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 |
|
|
|
|
|
#4 | |
|
minister of propaganda
![]() Join Date: Feb 2004
Location: Midsouth
Posts: 1,399
|
Quote:
__________________
rynoguill Ryan Guill, AKA Mark Roman |
|
|
|
|
|
|
#5 |
|
Hi there!
![]() ![]() ![]() ![]() ![]() ![]() 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 |
|
|
|
|
|
#6 |
|
FreeBSD The Power to Serve
![]() 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 ? ![]() |
|
|
|
|
|
#7 |
|
Test cases complete. 0 fails.
![]() 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 |
|
|
|
|
|
#8 | |
|
minister of propaganda
![]() Join Date: Feb 2004
Location: Midsouth
Posts: 1,399
|
Quote:
__________________
rynoguill Ryan Guill, AKA Mark Roman |
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 21:12.









[mmj] My momentous journey



Linear Mode
