ASP Site Design Question

Discussion in 'ASP General' started by McKirahan, Mar 17, 2005.

  1. McKirahan

    McKirahan Guest

    When developing a new site, I often use the following :

    <!-- This is page: WEB_Page.asp -->
    <!--#include file="WEB_0.asp"-->
    <!--#include file="WEB_1.asp"-->
    <!--#include file="WEB_Page.htm"-->
    <!--#include file="WEB_2.asp"-->

    "WEB" varies and is an acronym for a client's or site's name.

    "WEB_Page.asp" is the file above.
    "WEB_0.asp" contains shared ASP variables, subs, etc.
    "WEB_1.asp" contains shared page header HTML.
    "WEB_Page.htm" contains HTML for this page.
    "WEB_2.asp" contains shared page footer HTML.

    "WEB_1.asp" includes "WEB_1.css" which contains shared CSS.

    Other page names replace "_Page" with their own name.
    E.g., "Conact Us" pages = "WEB_Cont.asp" and "WEB_Cont.htm".
    (I use 8.3 naming as I have some utilities that manage my source.)

    I see the advantage to this is that I've isolated the content
    of each page into a file (e.g. "WEB_Page.htm") and can easily
    change the look-and-feel by changing two other files:
    "WEB_1.asp" and "WEB_2.asp" (and maybe "WEB_1.css").

    Another advantage is that by using the ".htm" extension,
    I can preview a page's content (albeit without formatting)
    by double-clicking on it's filename in Windows Explorer.

    My problem is that if the site already exists and I want to upgrade
    it to this approach (and I don't change page names) then the
    search engines will have already indexed the ".htm" files.
    Thus, visitors would see the "raw" content.

    Other than renaming my content with an ".html" extension, how
    can I automatically redirect visitors to the ".asp" page when they
    visit the corresponding ".htm" page?

    Thanks in advance for any suggestions.


    One thought I had while composing this post:
    I could associate a different extension in Windows Explorer
    so that a double-click will still open them in Internet Explorer.
    (And, of course, add a custom 404 page to redirect visitors.)
    McKirahan, Mar 17, 2005
    #1
    1. Advertising

  2. McKirahan

    McKirahan Guest

    Please do not top post:)

    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:...
    > delete the .htm and put in some custom handling in the 404 page, to

    redirect
    > from *.htm to *.asp, maybe keep a list of valid ones to prevent infinite
    > looping, etc.
    > Or just replace all the code in the .htm files with javascript redirectors
    >
    > --
    > Curt Christianson
    > Site & Scripts: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "McKirahan" <> wrote in message
    > news:...
    > > When developing a new site, I often use the following :
    > >
    > > <!-- This is page: WEB_Page.asp -->
    > > <!--#include file="WEB_0.asp"-->
    > > <!--#include file="WEB_1.asp"-->
    > > <!--#include file="WEB_Page.htm"-->
    > > <!--#include file="WEB_2.asp"-->
    > >
    > > "WEB" varies and is an acronym for a client's or site's name.
    > >
    > > "WEB_Page.asp" is the file above.
    > > "WEB_0.asp" contains shared ASP variables, subs, etc.
    > > "WEB_1.asp" contains shared page header HTML.
    > > "WEB_Page.htm" contains HTML for this page.
    > > "WEB_2.asp" contains shared page footer HTML.
    > >
    > > "WEB_1.asp" includes "WEB_1.css" which contains shared CSS.
    > >
    > > Other page names replace "_Page" with their own name.
    > > E.g., "Conact Us" pages = "WEB_Cont.asp" and "WEB_Cont.htm".
    > > (I use 8.3 naming as I have some utilities that manage my source.)
    > >
    > > I see the advantage to this is that I've isolated the content
    > > of each page into a file (e.g. "WEB_Page.htm") and can easily
    > > change the look-and-feel by changing two other files:
    > > "WEB_1.asp" and "WEB_2.asp" (and maybe "WEB_1.css").
    > >
    > > Another advantage is that by using the ".htm" extension,
    > > I can preview a page's content (albeit without formatting)
    > > by double-clicking on it's filename in Windows Explorer.
    > >
    > > My problem is that if the site already exists and I want to upgrade
    > > it to this approach (and I don't change page names) then the
    > > search engines will have already indexed the ".htm" files.
    > > Thus, visitors would see the "raw" content.
    > >
    > > Other than renaming my content with an ".html" extension, how
    > > can I automatically redirect visitors to the ".asp" page when they
    > > visit the corresponding ".htm" page?
    > >
    > > Thanks in advance for any suggestions.
    > >
    > >
    > > One thought I had while composing this post:
    > > I could associate a different extension in Windows Explorer
    > > so that a double-click will still open them in Internet Explorer.
    > > (And, of course, add a custom 404 page to redirect visitors.)


    Thanks for your reply.

    Placing the following at the top of "WEB_Page.htm" seems to work:

    <% If 0 = 1 Then %>
    <meta http-equiv="refresh" content="0;
    URL=http://www.domain.com/WEB_Page.asp">
    <% End If %>

    even though the <meta> tag is in the body of the page (inside of a table).

    The <meta> tag executes when the ".htm" page is invoked but is ignored if
    the ".asp" page (which "includes" the ".htm" file) is invoked.

    Any thoughts (from anyone)? Thanks.
    McKirahan, Mar 18, 2005
    #2
    1. Advertising

  3. McKirahan

    Bob Lehmann Guest

    Please do not bottom post:)

    >Any thoughts (from anyone)? Thanks.

    Yes. When someone helps you with your problem, don't try to enforce your
    misplaced ettiquette with them. Topposting is common in these groups.

    Bob Lehmann

    "McKirahan" <> wrote in message
    news:...
    > Please do not top post:)
    >
    > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > news:...
    > > delete the .htm and put in some custom handling in the 404 page, to

    > redirect
    > > from *.htm to *.asp, maybe keep a list of valid ones to prevent infinite
    > > looping, etc.
    > > Or just replace all the code in the .htm files with javascript

    redirectors
    > >
    > > --
    > > Curt Christianson
    > > Site & Scripts: http://www.Darkfalz.com
    > > Blog: http://blog.Darkfalz.com
    > >
    > >
    > > "McKirahan" <> wrote in message
    > > news:...
    > > > When developing a new site, I often use the following :
    > > >
    > > > <!-- This is page: WEB_Page.asp -->
    > > > <!--#include file="WEB_0.asp"-->
    > > > <!--#include file="WEB_1.asp"-->
    > > > <!--#include file="WEB_Page.htm"-->
    > > > <!--#include file="WEB_2.asp"-->
    > > >
    > > > "WEB" varies and is an acronym for a client's or site's name.
    > > >
    > > > "WEB_Page.asp" is the file above.
    > > > "WEB_0.asp" contains shared ASP variables, subs, etc.
    > > > "WEB_1.asp" contains shared page header HTML.
    > > > "WEB_Page.htm" contains HTML for this page.
    > > > "WEB_2.asp" contains shared page footer HTML.
    > > >
    > > > "WEB_1.asp" includes "WEB_1.css" which contains shared CSS.
    > > >
    > > > Other page names replace "_Page" with their own name.
    > > > E.g., "Conact Us" pages = "WEB_Cont.asp" and "WEB_Cont.htm".
    > > > (I use 8.3 naming as I have some utilities that manage my source.)
    > > >
    > > > I see the advantage to this is that I've isolated the content
    > > > of each page into a file (e.g. "WEB_Page.htm") and can easily
    > > > change the look-and-feel by changing two other files:
    > > > "WEB_1.asp" and "WEB_2.asp" (and maybe "WEB_1.css").
    > > >
    > > > Another advantage is that by using the ".htm" extension,
    > > > I can preview a page's content (albeit without formatting)
    > > > by double-clicking on it's filename in Windows Explorer.
    > > >
    > > > My problem is that if the site already exists and I want to upgrade
    > > > it to this approach (and I don't change page names) then the
    > > > search engines will have already indexed the ".htm" files.
    > > > Thus, visitors would see the "raw" content.
    > > >
    > > > Other than renaming my content with an ".html" extension, how
    > > > can I automatically redirect visitors to the ".asp" page when they
    > > > visit the corresponding ".htm" page?
    > > >
    > > > Thanks in advance for any suggestions.
    > > >
    > > >
    > > > One thought I had while composing this post:
    > > > I could associate a different extension in Windows Explorer
    > > > so that a double-click will still open them in Internet Explorer.
    > > > (And, of course, add a custom 404 page to redirect visitors.)

    >
    > Thanks for your reply.
    >
    > Placing the following at the top of "WEB_Page.htm" seems to work:
    >
    > <% If 0 = 1 Then %>
    > <meta http-equiv="refresh" content="0;
    > URL=http://www.domain.com/WEB_Page.asp">
    > <% End If %>
    >
    > even though the <meta> tag is in the body of the page (inside of a table).
    >
    > The <meta> tag executes when the ".htm" page is invoked but is ignored if
    > the ".asp" page (which "includes" the ".htm" file) is invoked.
    >
    > Any thoughts (from anyone)? Thanks.
    >
    >
    Bob Lehmann, Mar 18, 2005
    #3
  4. McKirahan

    McKirahan Guest

    "Bob Lehmann" <> wrote in message
    news:e9vxl#...
    > Please do not bottom post:)
    >
    > >Any thoughts (from anyone)? Thanks.

    > Yes. When someone helps you with your problem, don't try to enforce your
    > misplaced ettiquette with them. Topposting is common in these groups.
    >
    > Bob Lehmann


    [snip]

    "When replying to a message on the group trim quotes of the
    preceding messages to the minimum needed and add your comments
    below the pertinent section of quoted material, as per
    FYI28/RFC1855 (never top post)."

    -- http://www.jibbering.com/faq/
    McKirahan, Mar 18, 2005
    #4
  5. > "When replying to a message on the group trim quotes of the
    > preceding messages to the minimum needed and add your comments
    > below the pertinent section of quoted material, as per
    > FYI28/RFC1855 (never top post)."
    >
    > -- http://www.jibbering.com/faq/


    Oh Christ, not this again.

    I use both styles depending on the situation, and I'll stop using NNTP
    entirely before I'll be told how I should help people based on some stupid
    global dictation on some web site.
    Aaron [SQL Server MVP], Mar 18, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Hanks
    Replies:
    2
    Views:
    457
    Jason Hanks
    Jun 22, 2004
  2. =?Utf-8?B?am9obm55IHA=?=

    Asp.net site design question

    =?Utf-8?B?am9obm55IHA=?=, May 10, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    280
    =?Utf-8?B?QWRhciBXZXNsZXk=?=
    May 10, 2007
  3. Replies:
    0
    Views:
    431
  4. Replies:
    0
    Views:
    282
  5. Peter Woodsky

    Newbie eRuby site design question

    Peter Woodsky, Feb 19, 2008, in forum: Ruby
    Replies:
    4
    Views:
    108
    Arlen Cuss
    Feb 20, 2008
Loading...

Share This Page