[plug] multi-file find & replace

Greg Gamble gregg at maths.uwa.edu.au
Fri Oct 23 22:23:07 WST 1998


According to Shackleton, Kevin:
> I have a web site (done in frontpage) that refers to everything as
> ".htm".  Apache seems to prefer ".html".  How can I quickly find all
> occurrences in all files of '.htm"' and change them to '.html"'?  Some
> combination of shell and sed I suppose . .

Hi,

  When you say `Apache seems to prefer ".html"' do you mean that
  when given a URL with a trailing `/' Apache will look for a page
  index.html and serve it? ... if so, this behaviour can be modified.
  Locate the srm.conf file and uncomment the DirectoryIndex line
  and add a few more alternatives, in my srm.conf file I have:

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.

DirectoryIndex index.html index.shtml index.htm index.cgi

  Surely that's easier than editing all the .htm files and moving
  them. My srm.conf file is in /var/lib/httpd/conf

  I have quite a lot of documentation installed on my machine with
  both .htm amd .html extensions. With the above configuration there
  appears to be no difference in the way Apache handles the
  extensions.

  Hope that's useful.

  Regards,
  Greg Gamble <gregg at maths.uwa.edu.au>


More information about the plug mailing list