Welcome to WebmasterWorld Guest from 50.19.34.234

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

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

     

horseatingweeds

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

5+ Year Member



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

Thanks

horseatingweeds

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

5+ Year Member



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.

g1smd

5:37 pm on Nov 13, 2011 (gmt 0)

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



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.

lucy24

9:42 pm on Nov 13, 2011 (gmt 0)

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



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.

tangor

9:56 pm on Nov 13, 2011 (gmt 0)

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



Another approach is to go without extensions altogether... that way only allowed will be processed.

lucy24

12:28 am on Nov 14, 2011 (gmt 0)

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



:) 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 ;)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month