Welcome to Web Hosting Forum - Net Hosting Talk

Register now and be part of our community! When you register with the Net Hosting Talk you can join in with topics, start new topics, and generally be a part of the first level of our community. It's also quick and totally free, so what are you waiting for?

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

alvarez

Newbie
Messages
12
Reaction score
0
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,
 

robinson

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