Overwrite HTACCESS, In some SubDIR |
Overwrite HTACCESS, In some SubDIR |
Dag |
Jan 26 2017, 07:41 AM
Post
#1
|
Advanced Member Group: Members Posts: 122 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. |
Darin McGrew |
Jan 26 2017, 10:19 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,366 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Can you explain what you mean by "works without HTML"?
|
Dag |
Jan 29 2017, 04:54 AM
Post
#3
|
Advanced Member Group: Members Posts: 122 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) |
Christian J |
Jan 29 2017, 08:29 AM
Post
#4
|
. Group: WDG Moderators Posts: 9,722 Joined: 10-August 06 Member No.: 7 |
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 |
Dag |
Feb 13 2017, 05:48 AM
Post
#5
|
Advanced Member Group: Members Posts: 122 Joined: 24-October 06 Member No.: 549 |
Hm... I've answered on this post already... but nothing here.
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 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 Yep, that's it. Thanks Christian. |
Lo-Fi Version | Time is now: 25th September 2024 - 10:09 PM |