Jump to content

disable PHP processor on just a sub domain.


jasonc

Recommended Posts

I have created a sub domain for a friend to learn HTML, but just to be sure that anyone that is helping them does not mess up the main site i wish to disable the PHP, so that any files in that sub domain does not execute.

 

can this be done?

 

i do use PHP on the main site.

 

so...

 

sub.domain.com  can 'not' use PHP

domain.com  can use PHP

 

 

Link to comment
Share on other sites

in the root folder of his subdomain, you could do this in an .htaccess file:

 

RemoveType .php
AddType application/x-httpd-php-source .php
AddHandler application/x-httpd-php-source .php

 

hey thanks..

 

just tried the code and it still executed the code.

 

 

Link to comment
Share on other sites

edited..

 

yes i have use .htaccess before but not for long.

 

its the whole PHP that i want disabled in that sub domain, as PHP can be embeded in a HTML file too

 

on the main site i use PHP in a html file and used .htaccess to allow this.

 

 

sub.domain.com/.htaccess

...has this...

 

RemoveType .php

AddType application/x-httpd-php-source .php

AddHandler application/x-httpd-php-source .php

 

 

domain.com/.htaccess

...has this...

 

AddType application/x-httpd-php .html

AddType application/x-httpd-php .htm

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.