0

I have this rule for a redirect

RedirectRule ^/test+test.html /index.html [I,R=301]

and the index.html file exists in the root/ of the website however when I visit mysite/test+test.html I get a 404 error, maybe the plus (+) character need to be matched in another way, can anyone help me?

Max
  • 4,965
  • 17
  • 49
  • 64

1 Answers1

0

+ is special regex symbol meaning 1 or matches. Escape it as:

RedirectRule ^/test\+test.html /index.html [I,R=301]
anubhava
  • 761,203
  • 64
  • 569
  • 643
  • Oh ok try: `RedirectRule "^/test test.html" /index.html [I,R=301]` – anubhava Feb 26 '14 at 13:40
  • no, it does not work. I tried also with ^/test\xtest.html and ^/test\x20test.html My IIRF version is the latest 2.1 – Max Feb 26 '14 at 13:52
  • Hmm can you try adding `UrlDecoding Off` in your INI file? And then retest. – anubhava Feb 26 '14 at 15:53
  • also with "UrlDecoding OFF" in INI file does not work. I tried also with a rule like "RedirectRule ^/test([^/]+)* / [I,R=301]" to get all the occurrences that starts with "/test" but it fail again. I'm sad! just a note: the server is a 64bit and it's running 32bit version of IIRF. – Max Feb 27 '14 at 10:02