开发者

htaccess and AddType/Addhandler

开发者 https://www.devze.com 2023-02-14 20:01 出处:网络
My main site script uses php4, and it works fine with the AddHandler. Since the server is configured or php5.3 by default I assume when adding another script to a subdirectory all i would have to do i

My main site script uses php4, and it works fine with the AddHandler. Since the server is configured or php5.3 by default I assume when adding another script to a subdirectory all i would have to do is use one of the following Addhandler/AddType below but, it does not work. When I added anyone of the 3 lines before the pages are sent to the browser as a d开发者_运维技巧ownload so it doesn't process the file for display at all. my htaccess is completely blank expect for the Addhandler. Also this is on a dedicated server.

AddType application/php5-script php html tpl 
AddHandler application/x-httpd-php5 .php .php4 .php3 .phtml .tpl .html
AddHandler application/x-httpd-php53 .php .php4 .php3 .phtml .tpl .html

    to explain better..
    1. www.site.com is run php4 (script req. it)
    2. www.site.com/newscript/ needs php5
    3. i put a .htaccess in the www.site.com/newscript/ folder with 
Addhandler for php5 but it doesn't work


Am a bit confused by your question, do you mean you are running php 4 and 5 on the same server and want some parts of the site to run php4, some php5?

If it's a new server and you can't get the posted code to work have you tried

 AddType application/x-httpd-php .php .php4 .php3 .phtml .tpl .html


Server needs to be running latest PHP 5.3, you can downgrade with .htaccess to PHP 4 but if server is not running at least PHP 5.3 you can not make it do so with .htaccess. Got it?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号