How to setup a redirect for static files #158
-
Hi @D-Inventor. We were in touch recently on another Urltracker issue (DELETE verb). I'm hoping you are able to give me another hand on the following issue. We are using Urltracker v10.3 with Umbraco v10.5. Urltracker is working well for custom 301 redirects we have setup with the exception for static files. We have actually been using Urltracker for many years and recently upgraded our Umbraco environment from v7 to v10. While on v7 we successfully used Urltracker for static redirects, for ".html" pages from a long time ago. Now that we are on v10 we (actually our client) just realized that those redirects are not working anymore. After doing much research I cannot figure out how to get this setup. I'm always getting this generic 404 page from IIS: This xyz page can’t be found No webpage was found for the web address: xyz/xcvb.html We do have a custom 404 page handler setup with Umbraco but not even that is being triggered. I'm not sure if its related to an IIS setting, or something with the startup.cs or if its a config setting with Urltracker. In any event, if you would be able assist me with this that would be much appreciated. Best regards. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @paraxx2 ! Thank you for reaching out once more! From your description, I would guess that IIS is interfering here, like you said. I do not know exactly which settings iis requires, but I can provide an example web.config for you to draw inspiration from: web.config <?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="bin\Debug\net6.0\UmbracoWebsite.Web.exe" arguments="" stdoutLogEnabled="false" hostingModel="inprocess">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
<environmentVariable name="ASPNETCORE_HTTPS_PORT" value="443" />
</environmentVariables>
</aspNetCore>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration> Furthermore, I believe you need to configure your application pool and set I will also double check that the URL Tracker can still redirect static files. It should, but you never know. |
Beta Was this translation helpful? Give feedback.
-
That fixed the issue! Thank you. |
Beta Was this translation helpful? Give feedback.
Could you perhaps try enabling "force redirect" on one of your static html file redirects? I was told that forced redirects do work on static files.