How to redirect a site to external site?

How can you redirect a URL with the file extenstion from an .aspx site in a node.js + express project?

  • I have an existing site with the URL of http://www.bruxzir.com/video-bruxzir-zirconia-dental-crown/index.aspx but if someone follows that old link, they need to be redirected to the new link of http://www.bruxzir.com/video-bruxzir-zirconia-dental-crown/ Basically I need to rewrite the request to strip out the index.aspx if that is requested. This new site will be deployed as a node.js site to Heroku. (optional) Also interested in knowing how this might affect our SEO.

  • Answer:

    I would recommend using http://nginx.com/ for it. From my personal experience, it is always better to not expose node.js endpoints directly but have them routed through some module designed specifically for it. It may take you some 15 .. 30 minutes to figure out how to configure nginx redirect (and another 15 .. 30 minutes to figure out what nginx is if you have not used it), yet the end result will be worth it: the problem will be solved and you will not have to think of it again. Also, check in the resulting nginx config (the sites-enabled/X file) along with your node.js code into the source control. It will help later as well.

Dima Korolev at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.