473,569 Members | 2,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

301 redirect HTML to ASPX. options?

I'm helping convert a 300+ page .html site into an ASP.net site.

The client wants to set up 301 redirects for all of the old html pages. I've
used ISAPI for this type of thing in the past, as it works great and is easy
to set up, but at this point, the client (which is my client, who's working
with the actual client) doesn't know what the new web host supports.

In the interim, I want to do a bit of research myself on this to see if it's
anything I can handle on my end. It's in asp.net 1.1 right now, and from
what I can tell, it's quite easy to add a 301 redirect to an existing aspx
page. However, these are all .html pages, so it appears I'm out of luck with
that.

Do I have any other options to pursue outside of ISAPI Rewrite?

Converting to 2.0 probably isn't an option for this project, but that would
help in the future, correct, as ALL files can be intercepted by the .net
engine, correct? If that's true, is there any way to leave the current site
as an ASP.net 1.1 site but run a 'wrapper' application of some sort in 2.0
that can handle the 301 intercept/rewrites?

-Darrel
Dec 28 '07 #1
8 4909
You could put the old url and the new url in a sql table or a file and
have
one page that looks it up in the table and redirects
You can then set one
redirect in IIS on the web site level to send all traffic to your new page
instead of 300 different ones, one for each page.
Ah! That might work! So, IIS redirects to my page, and my page then does the
301 redirect. In that case, what kind of redirect do I use in IIS?

-Darrel
Dec 28 '07 #2
On Thu, 27 Dec 2007 20:53:00 -0800, Mohamad Elarabi [MCPD]
<Mo************ ****@discussion s.microsoft.com wrote:
>You could put the old url and the new url in a sql table or a file and have
one page that looks it up in the table and redirects. You can then set one
redirect in IIS on the web site level to send all traffic to your new page
instead of 300 different ones, one for each page.
Or make the root name of the aspx page the same as the html. You can
then replace the html in the original URL string with aspx and
redirect. That way you do not need the sql table the rest of the
redirect would remain as described.

This method also has the side effect that the structure of the site
remains the same so anyone working on the system using the old html
files will be familiar with the new layout. Effectively they are the
same.

Cheers,
Mark
--
|\ _,,,---,,_ A picture used to be worth a
ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
|,4- ) )-,_. ,\ ( `'-' came television!
'---''(_/--' `-'\_)

Mark Stevens (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
Dec 28 '07 #3
That would be true if he had 300 different aspx pages. But I doubt he has as
many aspx pages as his old HTML ones otherwise why bother with aspx.
My assumption is that he has a handful of aspx pages that can serve up
dynamic content that used to be hosted over 300 different html pages.

--
Mohamad Elarabi
MCP, MCTS, MCPD.
"Mark Stevens" wrote:
On Thu, 27 Dec 2007 20:53:00 -0800, Mohamad Elarabi [MCPD]
<Mo************ ****@discussion s.microsoft.com wrote:
You could put the old url and the new url in a sql table or a file and have
one page that looks it up in the table and redirects. You can then set one
redirect in IIS on the web site level to send all traffic to your new page
instead of 300 different ones, one for each page.

Or make the root name of the aspx page the same as the html. You can
then replace the html in the original URL string with aspx and
redirect. That way you do not need the sql table the rest of the
redirect would remain as described.

This method also has the side effect that the structure of the site
remains the same so anyone working on the system using the old html
files will be familiar with the new layout. Effectively they are the
same.

Cheers,
Mark
--
|\ _,,,---,,_ A picture used to be worth a
ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
|,4- ) )-,_. ,\ ( `'-' came television!
'---''(_/--' `-'\_)

Mark Stevens (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
Dec 28 '07 #4
IIS would be set to redirect to a single URL as I specified in my original
post. You would right click on the web site/Properties/Home Page Tab/"A
redirection to a URL" and in the text box you'd specify the exact url to your
new redirector aspx page and pass it the old url in the query string. It
should look something like this

http://myNewAppDomain/myRedirectorPag e.aspx?OldURL=$ S

Note that the $S should translate to the originally requested URL and it
should come to youe aspx page in a querystring variable called OldURL. You'd
parse that value and use it to lookup the page that you'll need to redirect
to.

If your aspx page is on the same site you can specify a virtual path instead
of an http:\\... one. There are other redirection options like redirecting to
a virtual folder under the same website. Unfortunately I am unable to help
you with anymore specific details since I don't have access to an IIS6.0 box
at the mean time. All I have access to is IIS7 on my vista laptop which is
entirely different. So hopefully the IIS interface is intuitive enough for
you to maneuver, I'm sure you can figure it out at least by trial and error
if need be. Also consider doing a Server.Transfer in your redirector page to
save a roundtrip this way your clients won't take 3 requests to get to their
target.

Hope this is clearer. Let me know.

--
Mohamad Elarabi
MCP, MCTS, MCPD.
"Darrel" wrote:
You could put the old url and the new url in a sql table or a file and
have
one page that looks it up in the table and redirects
You can then set one
redirect in IIS on the web site level to send all traffic to your new page
instead of 300 different ones, one for each page.

Ah! That might work! So, IIS redirects to my page, and my page then does the
301 redirect. In that case, what kind of redirect do I use in IIS?

-Darrel
Dec 28 '07 #5
That would be true if he had 300 different aspx pages. But I doubt he has
as
many aspx pages as his old HTML ones otherwise why bother with aspx.
Exactly. ;o)

Your answer makes sense. Though, is this HAS to be a 301 redirect. Does the
method of using the one aspx page result in (or can it result in) a 301
redirect message being sent back?
Dec 30 '07 #6
IF you do a response.redire ct(RedirectionU RLHere) then it is a 301 redirect
but if you do a Server.Transfer it won't look like a redirect to the client.
In general you want to minimize the number of 301 redirects because each one
is a round trip between the server and the client. So you set IIS to do a
redirect to your ASPX page and then your page can redirect again to the
target alternative. Now I'm not sure if the IIS redirect is a 301 or is it
seamless to the client, but my guess is that it is a 301 redirect. However,
if IIS doesn't do a 301 and you insist on having a 301 then your ASPX can do
a Response.Redire ct instead of a Server.Transfer .

In any case your client will not see a page that says "This page has moved,
you will be redirected in 5 seconds, if you're not redirected click here . .
.. " because this kind of page is something you'll need to write yourself. So
if that is what you want then your aspx page will need to do so and set a
refresh on the body tag of the page.

Hope that helps.

--
Mohamad Elarabi
MCP, MCTS, MCPD.
"Darrel" wrote:
>
That would be true if he had 300 different aspx pages. But I doubt he has
as
many aspx pages as his old HTML ones otherwise why bother with aspx.

Exactly. ;o)

Your answer makes sense. Though, is this HAS to be a 301 redirect. Does the
method of using the one aspx page result in (or can it result in) a 301
redirect message being sent back?
Dec 30 '07 #7


can u tell how to convert HTML pages to ASPX plzzz

*** Sent via Developersdex http://www.developersdex.com ***
Mar 7 '08 #8
Just rename them from .htm to .aspx
Also you will need to add first line <%@Page% (may be not i am not sure).

George.
"chanda roopesh" <ch************ @yahoo.comwrote in message
news:ep******** ******@TK2MSFTN GP05.phx.gbl...
>

can u tell how to convert HTML pages to ASPX plzzz

*** Sent via Developersdex http://www.developersdex.com ***

Mar 7 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3592
by: Nazir | last post by:
I am trying to do something pretty simple - but can't see how it can be done in ASP.NET. I have an aspx web page with a form which opens up a new window. The web page uses code behind to build the new window. There is simple validation on the form. However, after the form page validates and opens the new window, I want it to redirect...
3
2931
by: Guadala Harry | last post by:
I need to add logic to the Page_Load event behind a site's default.aspx; that will allow either default.aspx to load - OR load a completely different page instead of default.aspx. The other pages to possibly load exist within that site. The site owner says he wants to be able to specify any of his existing pages as the site's default - and to...
4
10590
by: bnob | last post by:
In a Button clik event I have this code at the end of the event Response.Redirect("Page.aspx") But in this event I must show a message before redirect to the Page.aspx. I use to show Message this System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">" & vbCrLf)...
3
3470
by: michael_vanommeren | last post by:
I have two web applications that I am working with and I am trying to do a Response.Redirect from one to the other. They are setup as separate web applications on the same IIS server. If I go directly to the second application in a browser, all of my events fire correctly. However, if I have the first application do a Response.Redirect to...
2
5966
by: news://news.microsoft.com/microsoft.public.de.germ | last post by:
Hallo! Ich habe ein Frameset mit 3 Frames. Im 1. Frame wird eine ASPX-Seite geöffnet. In dieser werden einige Steuerelemente angezeigt. Nun soll bei bestimmten Benutzeraktivitäten eine andere ASPX-Seite geöffnet werden, und zwar in einem der beiden anderen Frames. Mein Problem ist, dass die Seite, die geöffnet werden soll, manchmal im 2....
15
6374
by: KBuser | last post by:
I recently developed an internal website with various queries against our SQL server. I added buttons with Response.Redirect. These buttons do not work with Internet Explorer, however when using Firefox the page works flawless. Does anyone know why this is happening or how to fix it?
3
3971
by: wwwmike | last post by:
For some reasons my HTTP Redirect for 404 errors does not work for certain files like .gif .jpg on IIS Version: 5.1, but it works perfectly with the VisualStudio2005 internal webserver ****Web.Config**** ....... <customErrors mode="On" defaultRedirect="http://www.cnn.com"> <error statusCode="403" redirect="NoAccess.htm" /> <error...
0
1885
by: omer013 | last post by:
Hi; I have an aspx page with a WebMethod to redirect the user to another page. The Default.aspx.cs is; public partial class _Default : System.Web.UI.Page { public static void redirect_user() { HttpContext.Current.Response.Redirect("home.aspx"); }
7
8038
by: seanmatthewwalsh | last post by:
Hi I have a page (default.aspx) that pulls it's HTML from a database. I then have a "content management" page (editpage.aspx) that allows the user to edit the HTML in the database. When the user clicks the save button on editpage.aspx, the page updates the database and then redirects to the default.aspx page.
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.