Hello zee_ola05. There are the following reasons for this: a) The original .htaccess in some special cases caused conflicts with the server configuration (i.e. forbidden FollowSymLinks or missing modules) so the files could not be served at all, while the advantage of using .htaccess is not that much significant (you can normally win less than a second for the loading time if you configure your server properly). b) .htaccess only applies to Apache servers, while many people are also using IIS, so it would be reasonable to include web.config in the build as well then. Unfortunately, there does not seem to be a universal configuration file for IIS, as it would depend on whether URL Rewrite module has been installed or not. It has therefore been decided to add a server configuration guide to the documentation (coming soon) instead of including server configuration files in the build, as every server has its own features and limitations, so the developer can adjust the server configuration appropriately. You may use the following configuration files for your Release subfoder: 1) Release/.htaccess for Apache: Code (config): Options +SymLinksIfOwnerMatch <IfModule mod_rewrite.c> <IfModule mod_mime.c> RewriteEngine on RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{REQUEST_FILENAME}gz -f RewriteRule ^(.*)\.(js|data|mem|unity3d)$ $1.$2gz [L] AddEncoding gzip .jsgz AddEncoding gzip .datagz AddEncoding gzip .memgz AddEncoding gzip .unity3dgz </IfModule> </IfModule> 2) Release/web.config for IIS without URL Rewrite module installed (you need at least the following configuration to run your build from IIS server, as by default IIS does not serve files which do not have associated MIME type for its extensions, also note that you only need <remove fileExtension=".*" /> block if you expect MIME types to be overridden at the higher levels, in which case you might otherwise end up with error 500): Code (config): <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <staticContent> <remove fileExtension=".mem" /> <remove fileExtension=".data" /> <remove fileExtension=".unity3d" /> <remove fileExtension=".jsgz" /> <remove fileExtension=".memgz" /> <remove fileExtension=".datagz" /> <remove fileExtension=".unity3dgz" /> <mimeMap fileExtension=".mem" mimeType="application/octet-stream" /> <mimeMap fileExtension=".data" mimeType="application/octet-stream" /> <mimeMap fileExtension=".unity3d" mimeType="application/octet-stream" /> <mimeMap fileExtension=".jsgz" mimeType="application/octet-stream" /> <mimeMap fileExtension=".memgz" mimeType="application/octet-stream" /> <mimeMap fileExtension=".datagz" mimeType="application/octet-stream" /> <mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" /> </staticContent> </system.webServer> </configuration> 3) Release/web.config for IIS with URL Rewrite module (http://www.iis.net/downloads/microsoft/url-rewrite) installed (as mentioned before, you only need <remove fileExtension=".*" /> block if you expect MIME types to be overridden at the higher levels): Code (config): <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <staticContent> <remove fileExtension=".mem" /> <remove fileExtension=".data" /> <remove fileExtension=".unity3d" /> <remove fileExtension=".jsgz" /> <remove fileExtension=".memgz" /> <remove fileExtension=".datagz" /> <remove fileExtension=".unity3dgz" /> <mimeMap fileExtension=".mem" mimeType="application/octet-stream" /> <mimeMap fileExtension=".data" mimeType="application/octet-stream" /> <mimeMap fileExtension=".unity3d" mimeType="application/octet-stream" /> <mimeMap fileExtension=".jsgz" mimeType="application/octet-stream" /> <mimeMap fileExtension=".memgz" mimeType="application/octet-stream" /> <mimeMap fileExtension=".datagz" mimeType="application/octet-stream" /> <mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" /> </staticContent> <rewrite> <rules> <rule name="Append gz suffix to WebGL content requests"> <match url="(.*)\.(js|data|mem|unity3d)$" /> <conditions> <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> <add input="{REQUEST_FILENAME}gz" matchType="IsFile" /> </conditions> <action type="Rewrite" url="{R:1}.{R:2}gz" /> </rule> </rules> <outboundRules> <rule name="Append gzip Content-Encoding header to the rewritten responses"> <match serverVariable="RESPONSE_Content-Encoding" pattern=".*" /> <conditions> <add input="{REQUEST_FILENAME}" pattern="\.(js|data|mem|unity3d)gz$" /> </conditions> <action type="Rewrite" value="gzip" /> </rule> </outboundRules> </rewrite> </system.webServer> </configuration>
If the docs are going to be updated, i think it could be helpful to add the steps needed to host the game on popular cloud services (e.g: Amazon S3, for example). There are frequent questions here in the forums on how to host a WebGL game on platform X. If you include such information it could probably help out.
I have no acceess to configuration of URL Rewrite module. The loader is work incorrectly (0.0 and 1.0 values only). What to do? Unity 5.4.5.