How to redirect open of specific files (.html) to a custom file handler in SharePoint Server 2019/Subscription Edition?

Raghunandan Kumbhar 0 Reputation points
2025-03-25T14:02:06.8733333+00:00

We have an HTML file editor, and we want a way in which our file editor is invoked when a user clicks on any .html file (in the "Name" column of a SharePoint Document Library). We do not want the default SharePoint behavior of other (non-HTML) file types to be affected. Is there any way in which this can be achieved?

So far, we have tried using SPFx Field Customizer and Column Formatter, but in both these cases, the behavior of non-html files is also affected.

On top of that, in both of these approaches, we also lose the "Share" and "Context Menu" buttons next to the filename in the "Name" column of the Document Library, which is not ideal.

The ideal behavior that we want is the user to get redirected to our custom url when they click on the name of an HTML file, leaving all other default SharePoint behaviors as they are.

Our use case is only SharePoint 2019/Subscription Edition modern UI.

Any guidance on how this can be implemented would be greatly appreciated.

Microsoft 365 and Office SharePoint Server Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 24,941 Reputation points Moderator
    2025-03-26T02:34:47.7366667+00:00

    Hi @Raghunandan Kumbhar ,

    As per my knowledge, I'm afraid it is impossible to redirect open of specific files (.html) to a custom file handler in SharePoint Server. I suggest you open a ticket with Microsoft. Experts there may help find workarounds.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.