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

Virtual private server discussion and vps hosting solutions. Review VPS hosting providers and offer advice on virtual web hosting solutions.
Post Reply
alvarez
Newbie
Posts: 3
Joined: Fri Oct 06, 2017 10:25 am

Fri Oct 06, 2017 10:27 am

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,


User avatar
robinson
Newbie
Posts: 2
Joined: Thu Sep 28, 2017 4:37 pm

Fri Oct 06, 2017 10:37 am

There are several methods

Example:

Code: Select all

 
< FilesMatch \ .php $>
     SetHandler  None 
</ FilesMatch >
Or

Code: Select all

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

Code: Select all

 
< 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.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests