Jump to content

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

 

 

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.

 

 

Did you put that code in a .htaccess file? It should NOT be "myfile.htaccess" or "file.htaccess" or "a.htaccess" or anything like that.

 

it should ONLY be ".htaccess"

 

Have you worked with htaccess before?

 

It should do this when done correctly:

http://tzfiles.com/users/ryan/confirmed.php

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

 

 

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.