6

Every time I restart my server my URL rewrite rules seem to get reset. Recreating them every time is obviously frustrating!

I am running Windows Server 2008 R2 (fully updated), IIS 7.5 and IIS URL Rewrite 2.0.

Does anyone have any idea what could be causing this? Thank you in advance.

Jonathan
  • 1,309
  • 2
  • 22
  • 29
  • 4
    You should mention at very least IIS version and what URL Rewriting software do you use. – LazyOne Aug 17 '11 at 00:41
  • @LazyOne My apologies, I have now updated my question. – Jonathan Aug 17 '11 at 15:09
  • The only thing that I can think of is that you have some sort of backup/recovery software installed that is restoring specified folders/files to the original state. If your rules are stored in **web.config** file and only rewrite rules gets lost (all other settings changes are preserved) then I have no clue at all :(. But check your start up items in any case -- maybe you somehow have specific commands that will remove such rules (yes, it can be done via command line). – LazyOne Aug 18 '11 at 08:55

1 Answers1

8

Rather embarrassingly I have found that the issue was not related to a server restart. Instead, the loss occurred every time I published my site. I'd been setting up the rewrite directly on my server as I was unaware that the rule data is stored in the web.config file, meaning every time I'd publish my site the file would just get overwritten with my clean local copy.

To fix, I just set up the rules locally in IIS and re-published my site.

Jonathan
  • 1,309
  • 2
  • 22
  • 29