Web Hosting Forum - Net Hosting Talk

We are a community of individuals and businesses passionate about web hosting. Let's build, learn, and grow together.

Prohibit script execution (perl php or other) for a virtual host

alvarez

Novice
Member
Hello,

I must host a site in pure HTML (yes that still exists). It is agreed that this site must remain in pure HTML, and must therefore contain no script (php or otherwise).

I have configured a virtualhost for this site.

Now I'm looking for a clean way (so without .htaccess) to prevent script execution for this virtualhost and only for this virtualhost.

If someone has an idea I continue my research.

Regards,
 
  • Advertisement
  • There are several methods

    Example:
    Code:
    < FilesMatch \ .php $>
         SetHandler  None 
    </ FilesMatch >

    Or
    Code:
    < VirtualHost >>
         ServerName domain.com
         DocumentRoot / var / www / domain_html
         AddType text / plain php 
    </ VirtualHost >

    Code:
    < Directory / var / www / domain_html >
     RemoveHandler .php .phtml .php3 .php5 
     RemoveType .php .phtml .php3 .php5 
     php_flag engine off 
    </ Directory >

    But to be able to help you precisely you would have to give us more information, version Apache (Nginx?), OS, interpreter PHP, suphp or not, php version.
     

    Advertisement

    Back
    Top