I get a 403 Forbidden error during the Microsoft 365 sign-in redirect. How can I fix this?
When trying to connect the Microsoft 365 / Outlook Connector, the Microsoft login works, but after authentication you are redirected back to Joomla and receive a 403 Forbidden error.
Solution
You must explicitly allow the Microsoft 365 callback URL inside your .htaccess file.
Step-by-Step Instructions
- Open your site’s main
.htaccessfile located in your Joomla root directory. - Find the following line:
RewriteEngine On
- Below that, locate the administrator / backend section, which usually looks similar to this:
#### Back-end protection RewriteRule ^administrator/?$ - [L] RewriteRule ^administrator/index\.(php|html?)$ - [L]
- Immediately AFTER the backend protection rules, add this snippet:
<code># Allow any ms365 callback under /index.php/ms365/ RewriteCond %{REQUEST_URI} ^/administrator/index\.php/ms365/ [NC] RewriteRule .* - [L]
Final Example
Your .htaccess should look similar to this:
RewriteEngine On
#### Back-end protection
RewriteRule ^administrator/?$ - [L]
RewriteRule ^administrator/index\.(php|html?)$ - [L]
# Allow any ms365 callback under /index.php/ms365/
RewriteCond %{REQUEST_URI} ^/administrator/index\.php/ms365/ [NC]
RewriteRule .* - [L]