Technical Discussion
  >> Web Design / HTML / Web hosting Forum

Register (or login) on our website and you will not see this ad.

  Print Thread
Standard User ilh
(fountain of knowledge) Wed 10-Oct-12 17:13:38
Print Post

IIS global redirects

[link to this post]
At work we have a horrible CMS which sits on an IIS server. Years ago when we got the CMS (perhaps 2006 or something - well before I started working here!) they forced everyone to have the name of the product in the URL so it looks something like:

The bold bit being the offending part. A while later they realised that it was really stupid to make customers have it in the URL so I can now remove it (hurray!) except lots of links on our BIG website and many links generated by the CMS for emails are all the full link and as such if I remove the netcommunity/ (easy to do) then pretty much everything will break.

So, I have looked into this and what I think I need to do is get IT to add the URL rewrite module to the IIS server and then stick a rule in there.

So question 1) Is this a good plan?

Assuming it is then I have done a bit of reading up on the rules and came up with the following:

Pattern: ^NetCommunity/(+)$
Rewrite URL: {R1}

Question 2) Is that a good bit of pattern matching right there? I have no easy way of trying all of this out for myself and testing things so if someone on this forum knows what to do I would appreciate it. I use regular expressions with php but the URL Rewrite thing seemed slightly different.

It would make my life a whole lot easier if I could just tell the IT people what rule to put in rather than watching them have a 15 email conversation whilst they tell me they don't really know what to do and I should speak to some other person who doesn't know what to do!

Thanks in advance.


The sooner you get behind, the longer you have to catch up.

Edited by ilh (Wed 10-Oct-12 17:15:32)

Standard User pmb00cs
(eat-sleep-adslguide) Wed 10-Oct-12 22:11:32
Print Post

Re: IIS global redirects

[re: ilh] [link to this post]
Answer 1) Strikes me as perfectly reasonable thing to do, and redirects are a perfectly valid way of solving the sort of problem you have.

Answer 2) Unfortunately I am not familiar with the rewrite module for IIS that you link too, the rewrite rule looks almost valid for an apache rewrite, but I don't know if the differences are down to the differences in the rewrite modules or errors. I would suggest that a IT department should have some form of test environment to try your rewrite out on, but I can see how licensing costs could prevent this from being done on a limited budget (and Windows Server is not a cheap license, let alone the cost of the CMS license)

Also I would suggest adding what ever argument the rewrite module needs to make the rewrite a 301 redirect instead of an invisible rewrite so that clients know to index/cache/bookmark/whateverelse the new URL, but that is a strategic decision and not really a technical one.

happily chugging along on plusnet and Virginmedia (yes I am greedy)
My web server
  Print Thread

Jump to