-1

I know this topic has been discussed and beaten to death... But mine is so simple, perhaps I'm over-complicating it? I've written my share of .htaccess files, but it's always been for dynamic content. pagename.php?id=1 or whatever... But in this case, I have a 10 page static website. No CMS, no Database... Nice and simple, flat php files. PHO is only used for some include files. It's practically HTML.

However, I'd like to remove the extension off the links so that www.example.com/about.php becomes www.example.com/about

The tricky part I'm having is the existing URL's in the code

<a href="http://www.example.com/about.php">

I'd like to see re-written when the user rolls over and clicks it without the need to edit the website or change the filenames. While a seemingly simple task, I can't seem to get it to work? Any ideas what the rewrite rule would be?

tshepang
  • 12,111
  • 21
  • 91
  • 136
korkster
  • 37
  • 1
  • 3

1 Answers1

2

mod_rewrite doesn't rewrite your documents. It only rewrites requests sent by the browser (and the browser only sends a request after the user has clicked on the link, and even then the content of the currently shown page doesn't change).

Unless you want to go on a major research spree, chances are you'll have to edit your files.

Jan Krüger
  • 17,870
  • 3
  • 59
  • 51
  • argh, I was cautiously optimistic that it wasn't the case. Thing is, I could have sworn I've seen it before without dynamic content? I think I'll go on a 30 minute research spree and see what I can dig up... There must/hope/wishful thinking be a way to mask the extension? – korkster May 28 '12 at 19:23