Using Url Rewriting to Host Multiple Apps/Blogs

  • Home
  • ASP.net
  • Using Url Rewriting to Host Multiple Apps/Blogs

When you need different applications or blogs to have separate domain names, you will probably need a hosting at accepts multiple applications. But sometimes, you are fine with a single domain, but do want to host multiple blogs under it. For instance, I have a main blog, a separate fitness blog, a couple of MVC3 web applications, all running under the same domain, utsavized.com. When I tried hosting all these (2-3 MVC3 Aps, 2 wordpress blogs) on a single application hosting site, it caused some problems. When I looked around for solutions, I found out that a lot of people are having the same issue, especially when trying to host multiple wordpress blogs in their site. There are a couple of solutions, but the simplest and most efficient one, is a URL rewrite.

I will base my example assuming that you have a .NET hosting. Things might be a bit different for a Linux hosting.

So my issue was that I had everything on utsavized.com/… going to the blog. But at the same time, I also wanted utsavized.com/calorified to work with a calorie tracking MVC3 web app I was building. So for that to work, all you need is a few lines of rules in the root of your main “www” hosting folder inside the web.config file. You could also use the IIS manager to do this – which has a nice GUI to help you build more complex rules. You can Here is how one would like:

And you can add as many matches or ignores you would wish to add. This can even be used to change extensions to look more like RESTful URLs, although there are some performance issues with that. Oh well, at least for now, you can be on your way hosting as many apps as you’d like under a single app hosting plan, with 2 minutes of URL rewriting.

**One note for multiple wordpress blogs though: If your hosting plan only supports one instance of MySQL, then you will have to edit the config.php of your wordpress installation files and change the database prefix to something other than what you have for your existing blogs so that it does not interfere with them. If not, wordpress will refuse to install indicating that another version is already installed.

Tags:
Blog Comments

Precisely how have you figure all of this out relating to this topic? I enjoyed scanning this, Ill must visit other pages on your own site straight away.

This web page doesn’t display correctly on my apple iphone – you may want to try and repair that

Great article is there any chance I can take it and copy it onto my own blog

Wow, that’s what I was seeking for, what a data! existing
here at this blog, thanks admin of this web page.

I stumbled on your blog and found a gold mine! You got a great blog with amzaing posts about daily blessing that we take for granted sometimes. It makes me reflect upon my life. God bless!

Leave a Comment