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.

3
  • 4
    You should mention at very least IIS version and what URL Rewriting software do you use.
    – LazyOne
    Aug 17, 2011 at 0:41
  • @LazyOne My apologies, I have now updated my question.
    – Jonathan
    Aug 17, 2011 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, 2011 at 8:55

1 Answer 1

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.

1
  • +1. Thanks God I am not the only one with such a tricky issue.
    – Alexei
    Oct 18, 2018 at 11:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .