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

  1. Open your site’s main .htaccess file located in your Joomla root directory.
  2. Find the following line:
    RewriteEngine On
    	
  3. 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]
    	
  4. 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]

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us