Primary SSI not working

It makes my halo. I am trying to get the server side to work. The server on which my site is hosted has an SSI, and the company that owns the servers stated that my problem was with my code and not with their servers.

Here my file is called test.html

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> <body> <!--#include file="assets/includes/top.html" --> </body> </html> 

The top.html file is just a bunch of html, there is nothing to worry about.

When I call the main test.shtml file, it works fine. When I call it test.html, it is not. When I googled it, he said what to do with file parsing. How does this relate to the code? What can I do to make it work with the .html extension. (I cannot use .shtml for SEO reasons).

+4
source share
2 answers

Add the following commands to the .htaccess file:

 # Enable server side includes Options +Includes # pass .html files to the server for parsing AddHandler server-parsed .html 

References

+4
source

I had the same problem. Now I use xampp and I added these lines before VirtualHost declarations

 <Directory /> Options FollowSymLinks Indexes Includes AllowOverride All Order allow,deny Allow from All Satisfy any AddType text/html .shtml .html .htm AddOutputFilter INCLUDES .shtml .html .htm <Limit PUT> Order allow,deny Deny from all </Limit> </Directory> 

Hope for this help

-1
source

Source: https://habr.com/ru/post/1438727/


All Articles