ASP Site Design Question

M

McKirahan

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.)
 
M

McKirahan

Please do not top post:)

Curt_C said:
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

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.
 
B

Bob Lehmann

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
 
M

McKirahan

Bob Lehmann said:
Please do not bottom post:)

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/
 
A

Aaron [SQL Server MVP]

"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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top