Forum Moderators: phranque

Message Too Old, No Replies

.htaccess on GoDaddy hosted site

need to point old .htm pages to new .aspx pages

         

washgirl

4:48 am on Jan 6, 2009 (gmt 0)

10+ Year Member



Help!?! Just relaunched our site and now need to point old .htm pages to new .aspx pages. We're using GoDaddy. We are totally new to all of this. We added a .htaccess file to our main directory on the FTP site. The file consists of the following kinds of statements:

Redirect /oldpagename.htm http://www.example.com/subdirectory/newpagename.aspx

Redirect /oldpagename2.htm http://www.example.com/subdirectory/newpagename2.aspx

... and so on. Our domain name didn't change, it's just the page names that have changed. And unfortunately the new pages were created with a CMS in ASP.NET so we can't change their URLs.

Unfortunately when we go to http://www.example.com/oldpagename2.htm, we receive an "oops! page not found" error.

Please help! Our old pages are still appearing in search engines, so this looks very bad for our company.

[edited by: jdMorgan at 7:02 am (utc) on Jan. 6, 2009]
[edit reason] example.com [/edit]

jdMorgan

7:06 am on Jan 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is your site still hosted on an Apache server? ASP.NET implies a Microsoft server, while .htaccess implies an Apache server.

Jim

washgirl

3:58 pm on Jan 6, 2009 (gmt 0)

10+ Year Member



Jim, ah ha. That was my confusion. We must indeed have a Microsoft server. Is there any correlary for the .htaccess solution with Microsoft? If so, I would be ever grateful to know it!

jdMorgan

5:05 pm on Jan 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use the IIS administration control panel, and select (IIRC) "a permanent redirect to a URL."

If the controls there are too limited, you will need to use ISAPI Rewrite, which may or may not be available as an added-cost option.

Jim

g1smd

11:27 pm on Jan 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



** Our domain name didn't change, it's just the page names that have changed. And unfortunately the new pages were created with a CMS in ASP.NET so we can't change their URLs. **

Hold on a moment. That's not entirely true.

It is the names within the server filesystem that have changed.

It is very possible to retain the same URLs - if you use a rewrite to connect the right URL request with the right internal filepath.

A rewrite translates the requested URL into a local filesystem filepath, one that is different to the filepath that is suggested by the URL.

jdMorgan

1:17 am on Jan 7, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you can change the filenames without changing the URLs at all -- If you have ISAPI Rewrite.

In fact, you then have the choice of keeping the old URLs, or changing over (quickly or slowly) to using extensionless URLs, so that this never need happen again.

Jim

washgirl

2:23 am on Jan 7, 2009 (gmt 0)

10+ Year Member



Very good to know. I am in a holding pattern for the moment until I hear back from Go Daddy on ISAPI Rewrite. Fingers crossed.

washgirl

1:50 am on Jan 13, 2009 (gmt 0)

10+ Year Member



OK, long delay on my side because I was trying in vain to solve on my own… unfortunately I’m stuck. GoDaddy came back with a way of customizing IIS settings, but then advised “You will not be able to redirect through a URL in IIS on shared hosting. This functionality is only enabled on Virtual Dedicated or Dedicated servers. You will need to use an ASP.NET redirect script in order to perform this redirect for a specific domain.” So unfortunately I’m not able to add the ISAPI dll.

Meanwhile, I don’t have the correct redirect script to deal with a move from www.site.com/oldpage.htm to www.site.com/newpage.aspx. I’m able to create www.site.com/oldpage.htm but haven’t located the correct code for redirecting (I believe the code needs to exist on oldpage.htm rather than newpage.aspx?). If you have any “code for dummies” that you could share with me so that I can go this less optimal route (my only option at this point), I’d be grateful for it.

jdMorgan

4:42 pm on Jan 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes the redirect code needs to be in oldpage.htm - Replace the old page content with that code, and configure the server to parse .htm files for asp.net scripts (to run asp.net scripts even on .htm pages).

I think you'll likely find the asp.net redirect code in the Forum Library over in our Microsoft IIS Web Server and ASP.NET [webmasterworld.com] forum, as well as a lot more IIS server expertise than you'll find here in the Apache forum... :)

See the "Library" and "Search" links at the top of the forum pages here at WebmasterWorld.

Jim

washgirl

9:09 pm on Jan 15, 2009 (gmt 0)

10+ Year Member



In case another IIS person stumbles across this thread and faces a similar challenge... happily, we were given a workaround: [webmasterworld.com...]