お名前com のサーバー(レンタルサーバーRSプラン)で、拡張子htmlのままphpを動かしたい。
解決したいこと
お名前com のサーバー(レンタルサーバーRSプラン)で、拡張子htmlのままphpを動かしたい。
さくらインターネットから、お名前.comのサーバーにホームページを移したいのですが、.htaccessで、htmlのままphpが動くようにしていたので、下記のページを見て、.htaccess と php-cgi を設置しましたが、表示されません…。。。文字コードや改行コードを変えてもダメです。
発生している問題・エラー
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
ログを見てみましたが、よくわからず…。
[Sun Apr 18 16:43:47.898276 2021] [cgi:error] [pid 357351] [client 180.34.70.77:0] AH01215: suexec policy violation: see suexec log for more details: /home/r1939859/public_html/sana-kashiwa.com/php.cgi
[Sun Apr 18 16:43:47.898395 2021] [cgi:error] [pid 357351] [client 180.34.70.77:0] End of script output before headers: php.cgi
諦めて拡張子をphpにしてもいいのですが、アンカーリンクが残らないようにするための以下のjsが効かなくなってしまいます。(ホームページのURL/index.php#access(←ページ内リンク)になる。)
該当するソースコード
document.addEventListener('touchstart', function() {}, {passive: true});
$(function(){
$('a[href^=#]').click(function() {
var position = 0;
var href= $(this).attr("href");
if(href.indexOf('#') >= 0 && $(href).size() && href != '' && href != '#'){
var target = $(href);
try{
position = target.offset().top;
}catch(e){
}
}
var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
var speed = Math.ceil(Math.pow(Math.abs((position - scrollY)), 0.7));
if(speed){
$('body, html').animate({scrollTop:position}, speed, 'swing');
}
history.replaceState(null, '', location.pathname)
return false;
});
});
htmlのままphpが使えるようにするか、phpで、URLにアンカーリンクが残らないようにするか、どちらかが解決できればいいのですが、どうしたら解決できるでしょうか?