jasonc Posted October 19, 2008 Share Posted October 19, 2008 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 Quote Link to comment Share on other sites More sharing options...
Zane Posted October 19, 2008 Share Posted October 19, 2008 Is this on an Apache or IIS server Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted October 19, 2008 Share Posted October 19, 2008 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 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 19, 2008 Share Posted October 19, 2008 It would be a lot easier and faster (no wasted time FTP'ing code) to learn HTML or any other web technology on a local development system. Quote Link to comment Share on other sites More sharing options...
jasonc Posted October 19, 2008 Author Share Posted October 19, 2008 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. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted October 19, 2008 Share Posted October 19, 2008 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 Quote Link to comment Share on other sites More sharing options...
jasonc Posted October 19, 2008 Author Share Posted October 19, 2008 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 Quote Link to comment Share on other sites More sharing options...
corbin Posted October 19, 2008 Share Posted October 19, 2008 Why not just do it in his virtual host config? <VirtualHost *:80> ServerName something.something.com DocumentRoot "/some/folders/" RemoveType .php #Remove html and readd </VirtualHost> Or you could do it with a <Directory> tag. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.