Welcome to WebmasterWorld Guest from 23.22.140.143

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Direct Apache to send #*$!.htm IF #*$!.html does not exist.

     
2:38 pm on Nov 13, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 4, 2006
posts:85
votes: 0


How should I go about directing Apache to send "example.htm" is "example.html" does not exist?

Thanks
3:40 pm on Nov 13, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 4, 2006
posts:85
votes: 0


I figured it out. It's more simple than I was thinking. There's an option MultiViews which looks for the best match to a file.
5:37 pm on Nov 13, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


That opens up your site to an infinite amount of duplicate content issues.

You should instead install a 301 redirect. Code for that is posted at least once per day in this forum.
9:42 pm on Nov 13, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12708
votes: 244


It's almost exactly the same principle as redirecting with-or-without www. to your preferred format. If you really have a significant number of people aiming for the wrong extension, add a general \.html to \.htm redirect. And, as with all other generic redirects, make sure your own links-- and any others that you have control over-- are correct.
9:56 pm on Nov 13, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:6148
votes: 282


Another approach is to go without extensions altogether... that way only allowed will be processed.
12:28 am on Nov 14, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12708
votes: 244


:) I knew someone would suggest that-- but here we seem to be talking about pages that already exist, so you wouldn't exactly be saving yourself any trouble. More work in fact, since you first have to do a redirect to put existing links into the new format, and then a rewrite to fetch contact from where it really lives.

But then, my automatic reaction to an extensionless url is to tell it to go put some clothes on ;)