Forum Discussion
Running WordPress from a Subfolder in Azure App Service - Not Working
define( 'WP_HOME', 'https://mydomain.com/blog' );
define( 'WP_SITEURL', 'https://mydomain.com/blog' );
Update .htaccess File
Your current .htaccess file looks almost correct, but it may need to be adjusted for Azure's Linux environment.
Try this configuration:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
Redirect everything else to the correct subdirectory.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
Check Azure App Service Path and Folder Structure
Ensure the folder structure is correctly set up on Azure App Service:
- WordPress files should be inside the /site/wwwroot/mysite/blog folder.
- Confirm that your Azure app is running PHP properly, and all necessary PHP extensions for WordPress are enabled (e.g., mod_rewrite for URL rewriting).
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false ); // Set to false for subdirectories
define( 'DOMAIN_CURRENT_SITE', 'mydomain.com' );
define( 'PATH_CURRENT_SITE', '/blog/' ); // Ensure this is set correctly
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
File Permissions
Make sure that the file permissions are correct for the /blog directory and its contents:
- Use FTP or Azure CLI to ensure files have the correct permissions (e.g., 755 for directories and 644 for files).
Check that the wp-config.php file and other critical files have the appropriate permissions.