KBD

Keith Devens .com

Sunday, March 21, 2010 Flag waving
And if you go too far up, abstraction-wise, you run out of oxygen. Sometimes smart thinkers just don't... – Joel Spolsky
← Web architectureUltimate DVD Burner! →

Daily link icon Wednesday, September 18, 2002

No extensions

Yes! No extensions.

I have a mod_rewrite rule to have most things work with no extensions.

RewriteRule ^([^.]+[^/])$ $1/ [R=permanent,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+[^/]) $1.php

With these rules any normal file will look like a directory. So if you go to http://www.keithdevens.com/programming it'll make it look like http://www.keithdevens.com/programming/, and you'll actually be seeing http://www.keithdevens.com/programming.php. It all works seamlessly - it's pretty nice.

Note, if you're actually going to implement this, read this.

← Web architectureUltimate DVD Burner! →

Comments XML gif

Adam Vandenberg wrote:

No extensions rules.

∴ Adam Vandenberg | 19-Sep-2002 12:26am est | #807

Ask Bjoern Hansen (http://www.askbjoernhansen.com/) wrote:

Just watch out for any relative document references....

:-)

- ask

∴ Ask Bjoern Hansen | 19-Sep-2002 4:16am est | http://www.askbjoernhansen.com/ | #808

Keith (http://www.keithdevens.com/) wrote:

Sorry, relative document references?

Keith | 19-Sep-2002 11:02am est | http://www.keithdevens.com/ | #809

Keith (http://www.keithdevens.com/) wrote:

Oh, you may be referring to the RewriteBase. I actually have:

RewriteEngine On
RewriteBase /

up above what I listed.

Keith | 19-Sep-2002 11:07am est | http://www.keithdevens.com/ | #810

Dean Peters (http://www.healyourchurchwebsite.com) wrote:

∴ Dean Peters | 19-Sep-2002 4:07pm est | http://www.healyourchurchwebsite.com | #811

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

March 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 3 posts

Recent comments XML

new⇒Spider solitaire

I to am somewhat addicted to​spending too much time on SS.  I​have been stu...

stupid_horse: Mar 20, 10:34pm

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.206s.

(Used 8 db queries)