On Apache, the .htaccess that ships with the package sends every address of the chat’s folder to its front controller. You copied it in step 3 of Installing.
This is public/opensolr-chat/.htaccess, a copy of vendor/opensolr/chat-bot-client/examples/apache.htaccess:
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L,QSA]
</IfModule>
<IfModule mod_setenvif.c>
SetEnvIf Request_URI "/chat$" no-gzip=1 dont-vary=1
</IfModule>- Options -Indexes turns off directory listings.
- The rewrite rule sends every address under the folder to
index.php: the widget, its settings, the chat itself and the admin. - The SetEnvIf line turns compression off for the chat’s answers, so they arrive word by word.
mod_rewriteenabled. On Debian and Ubuntu:sudo a2enmod rewrite, then reload Apache..htaccessallowed in that folder:AllowOverride FileInfo Options, orAllowOverride All, in your Apache configuration.- The file named
.htaccess, with the dot, next toindex.php.
If your Apache does not read .htaccess in that folder, put the same lines in a <Directory> block of your virtual host.
- With PHP-FPM behind Apache, one more line in your virtual host decides whether answers arrive word by word: see Streaming through your server.
- With mod_php, nothing more than the
.htaccess.
Check it: https://your-site/opensolr-chat/widget.js must open as JavaScript. A 404 means the rewrite does not reach the folder: see Troubleshooting.
Install on your server
- Installing
- Mounting on Apache
- Mounting on nginx
- Behind a proxy
- Streaming