KBD

Keith Devens .com

Friday, July 30, 2010 Flag waving
Of course, that's just my opinion. I could be wrong. – Dennis Miller
← 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)
:

July 2010
SunMonTueWedThuFriSat
 123
45678910
11121314151617
18192021222324
25262728293031



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

Recent comments XML

DTerm: A command line anywhere and everywhere

They wrote back. It turns out that,​when I launched it a second time, I​was...

Revence: Jul 26, 2:28am

Minimum Wage Increase Leads to Higher Teen Unemployment Rate - WSJ.com

Sorry, I don't believe it.  My son​was working as a dishwasher, making​$10/...

Bryan Price: Jul 25, 2:50pm

Generated in about 0.123s.

(Used 8 db queries)