Search code examples
htmlpre

Some htaccess code not appearing within HTML <code> and <pre> elements


I have the following code

<pre>
  <p style="margin:0;font-weight:bold;padding:5px;">HTACCESS Test</p><hr>
  <code>
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
  </code>
</pre>

As you can see when running the code, the <FilesMatch "^\."> and </FilesMatch> lines do not appear. Is there something I am doing wrong?

Thanks in advance


Solution

  • For others looking for a solution, you need to escape HTML characters when using them in within <pre> and <code> tags.