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

Welcome to our community

Be apart of something great, join today!

alvarez

Newbie
Messages
12
Reaction score
0
Points
1
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
  • robinson

    Newbie
    Messages
    9
    Reaction score
    2
    Points
    3
    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

    Top