The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Overwrite HTACCESS, In some SubDIR
Dag
post Jan 26 2017, 07:41 AM
Post #1


Member
***

Group: Members
Posts: 79
Joined: 24-October 06
Member No.: 549



I have next lines in my htaccess in the web site root:
CODE

DirectoryIndex index index.html index.htm index.php
Options +MultiViews
AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml .html .htm
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .html
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .htm
AddHandler cgi-script .php
AddType text/html .php


How to overwrite (kill, cancel, dismiss…) all above to have files .PHP to works without HTML in some DIR as WebSiteRoot/SomeDIR/do.php

Thanks in advance.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jan 26 2017, 10:19 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,245
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Can you explain what you mean by "works without HTML"?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dag
post Jan 29 2017, 04:54 AM
Post #3


Member
***

Group: Members
Posts: 79
Joined: 24-October 06
Member No.: 549



Sorry for wild phrase Darin. I meant .PHP files to works with theirs own extension.

When I configured my server, I’ve asked hoster to avoid this:
SetHandler application/x-httpd-php
PHP not to be processed as application. They made htaccess as I posted and results were next:
Does not work (didn’t work):
http://laban.rs/_phpinfo.php

Works:
CODE

http://laban.rs/phpinfo.html
Content of phpinfo.html is:
<?php
        include $_SERVER["DOCUMENT_ROOT"]."/_phpinfo.php";
?>


So I thought that line
CODE

AddHandler cgi-script .php

were necessary and that is the key line which made the trick and that was ok with me.
But, when I try to play with wordpress, I’ve notice that nothing can work with my current setting.
http://laban.rs/wp/ (index.php is there) returned server error (php can’t be understood)

Host server admin wrote: "Just do comment the line
CODE

AddHandler cgi-script .php

and everything will work."
And he was perfectly right!!!
http://laban.rs/_phpinfo.php works now, /wp/ works too and *.html works.

1. Now I am not sure why I needed that line ever (few years ago) or what that exactly do?
2. Question remains unanswered: how to overwrite setting (any) from DIR one level up. Something as:
CODE

htaccess
DIR /A/ a = 24
DIR /A/S/ a = nothing (forget about a)


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 29 2017, 08:29 AM
Post #4


.
********

Group: WDG Moderators
Posts: 7,496
Joined: 10-August 06
Member No.: 7



QUOTE(Dag @ Jan 29 2017, 10:54 AM) *

1. Now I am not sure why I needed that line ever (few years ago) or what that exactly do?

Could it have something to do with running PHP as CGI?

QUOTE
2. Question remains unanswered: how to overwrite setting (any) from DIR one level up.

Would this work: https://httpd.apache.org/docs/2.4/mod/mod_m...l#removehandler unsure.gif

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dag
post Feb 13 2017, 05:48 AM
Post #5


Member
***

Group: Members
Posts: 79
Joined: 24-October 06
Member No.: 549



Hm... I've answered on this post already... but nothing here.

QUOTE(Christian J @ Jan 29 2017, 05:29 PM) *

QUOTE(Dag @ Jan 29 2017, 10:54 AM) *

1. Now I am not sure why I needed that line ever (few years ago) or what that exactly do?

Could it have something to do with running PHP as CGI?

It should of course but seems that I don't need it at all. My PHP coding is recognized. Ex-hoster guy told me that there are 2 possibilities: or PHP as application or as CGI. He was wrong.

QUOTE(Christian J @ Jan 29 2017, 05:30 PM) *

QUOTE
2. Question remains unanswered: how to overwrite setting (any) from DIR one level up.

Would this work: https://httpd.apache.org/docs/2.4/mod/mod_m...l#removehandler unsure.gif

Yep, that's it. Thanks Christian.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 22nd March 2017 - 11:19 PM