I'm trying to redirect about 40 web addresses from an old site to a new site. I was able to redirect all of the pages that DO NOT have a ".aspx" in them to the new site using .htaccess but I cannot figure out how to redirect the .aspx links. I was told I need to do it in the web.config file.

Can someone please help?

I moved a site from www.handstands.com to www.randombuy.com.

Here is an example of a link that works using .htaccess and one that does not.

Works: http://www.handstands.com/info/About_Us

Doesn't work: http://www.handstands.com/p-294-keuken-5-piece-ceramic-knife-set-with-bamboo-block.aspx (should go to: http://www.randombuy.com/p-294-keuken-5-piece-ceramic-knife-set-with-bamboo-block.aspx)

Any help would be appreciated.

Thank you,
Darrin Keller

Recommended Answers

All 7 Replies

Hi,

Hope the following links will help you.

How do I use .htaccess to redirect an aspx page to a php page?
Redirect any page that has an .aspx ending to a new url.

Thank you for these links. However, I checked into them and I don't think they tell me what needs to be done. I am redirecting from an .aspx to an .aspx but I'm using a PHP server to do the forwarding... I have multiple individual URLs that I wanted to redirect.

Do you have any other ideas?

Thanks,
Darrin Keller

you need to write URL rewrite in web.config file. It will fix your problem.

you need to write URL rewrite in web.config file. It will fix your problem.

Thanks but I don't know how to do that. I thought that if I could figure out a way to forward all .aspx to the new website, it would work. But in the interim, I figured out how to forward all error messages to the new site so it effectively works the same way.

Does anyone have any suggestions on how to set this up?

Thanks!
Darrin

Hi AussieWebmaster...I would suggest you start with this link. http://www.iis.net/download/urlrewrite.

Setting up the URL Rewrite module just requires an isntallation of hte module, configuration on IIS, then modify the web.config file on your website.

The exact details are very long for this thread. I can tell you that when I needed to learn about URL Rewriting, I started with the link that I posted. IIS.net has many articles and tutorials on this subject.

Installing the URL rewrite nodule on an IIS server is very easy. The more challenging part is learning how to write the URL Rewrite rules. Once you learn, you'll find it to be very powerfull.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.