.htaccess or mail autodiscover

dotcomUNDERGROUND

Verified User
Joined
Mar 31, 2022
Messages
20
I am following instructions provided here: https://docs.directadmin.com/other-hosting-services/email/autodiscover.html

I am running OpenLiteSpeed. Does the provided .htaccess code work with OLS?
I have created the .htaccess file with file manager. Also have restarted OLS.

But visiting the autoconfig domain (autodiscover.hostname.com) gives 404 without index.html and shows the index file with index.html
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ autodiscover.php [NC,L]
 
autodiscover.hostname.com/no-file.html was showing autodiscover.php content. But autodiscover.hostname.com was giving 404.
I have created index.php with content of autodiscover.php which solves the issue.
 
Back
Top