How to fix canonical issues with WordPress on App Services

Joe O 0 Reputation points

I need to redirect to I have a custom domain with SSL, https enforced. Http requests are being redirected to https and working as expected. Where, or how, do I configure a redirect to get the www.example to redirect to

The WordPress site was installed on App Services as described here:

This version of the the installation uses PHP v8 on nginx. As mentioned, I have a custom domain with example as the A record and www.example as a cname on that domain. Each is secured with individual free SSL certificates from App Services, with bindings. The app is configured to enforce https.

Any assistance would be greatly appreciated.

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
968 questions
A set of technologies in the .NET Framework for building web applications and XML web services.
4,226 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,399 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,988 questions
{count} votes

2 answers

Sort by: Most helpful
  1. JimmySalian-2011 41,926 Reputation points


    Do you use App Gateway as this might assist in redirection and applying L7 policies as well. If not try this process -

    Hope this helps.



    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

  2. SnehaAgrawal-MSFT 18,541 Reputation points

    Thanks for reaching here! It seems you are using WordPress site is hosted on Linux for this your app root directory (/home/site/wwwroot), is using the new PHP 8 blessed image, which uses nginx as webserver in place of Apache.

    For configuring redirect suggest you to refer this blog postfor how to make rewrite rules for nginx using the .htaccess file.

    Let us know if further query.

    1 person found this answer helpful.
    0 comments No comments