I have added a redirect to the UrlRewriting.config file but I am getting some weird behaviour when I test it. I have a custom URL that is redirecting to a totally separate domain that we do not control.
I had a look through the web.config but I can't see anything that could be adding the slash.
I think it is copying the redirect string and appending it to the destination URL which is leading me to believe it is my regex that isn't quite right.
Redirect Adding a Trailing Slash
I have added a redirect to the
UrlRewriting.config
file but I am getting some weird behaviour when I test it. I have a custom URL that is redirecting to a totally separate domain that we do not control.The rule is:
However it is redirecting me to
http://example.com/sites/default/files/filename.pdf/
(which is a 404) instead ofhttp://example.com/sites/default/files/filename.pdf
.What I need to happen is if an end user types in
http://test.com/vanityurl
orhttp://test.com/vanityurl/
they end up at the PDF in the rule.I think I might have missed something in my regex, but I'm not sure what. Any suggestions?
Hi burgi,
Do you have any rules in your web.config that add the trailing slash? Maybe worth checking and if it's present, negating it for files.
Hi Ben
I had a look through the
web.config
but I can't see anything that could be adding the slash.I think it is copying the redirect string and appending it to the destination URL which is leading me to believe it is my regex that isn't quite right.
is working on a reply...