2017-03-02 6 views
0

私はprerender.io javascriptミドルウェアを使用して自分のWebサイトにJSページを表示しています。prerender htaccess書き換えルールからindex.phpを削除

htaccessミドルウェアコードは以下の通りです。これで

RewriteCond %{HTTP_USER_AGENT} googlebot|bing|msnbot|yandex|yahoo|baidu|facebook|screaming|siteliner|ahrefsbot|dmca.com [NC,OR] 
    RewriteCond %{QUERY_STRING} _escaped_fragment_ 
    RewriteCond %{HTTP:X-Prerender} !1 

    # Only proxy the request to Prerender if it's a request for HTML 
    RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.svg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff))(.*) http://service.prerender.io/https://www.example.com/$2 [P,L] 

問題、少なくとも(ただし、いくつかの他の)私のサーバー上でエラーが発生したサービスに送信されたURLに追加されindex.phpのです。

EG:https://www.example.com/index.php

は、それはそれを停止することは可能ですか?

EG:https://www.example.com/

感謝。

答えて

0

まず、_escaped_fragment_クロールプロトコルをサポートしているので、ユーザーエージェントがgooglebot、bingbot、またはyandexをチェックしたくない場合。ユーザーエージェントによってそれらをチェックすることは、あなたに偽装の罰を与えることができます。

は、この行を変更してみてください。これに

RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.svg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff))(.*) http://service.prerender.io/https://www.example.com/$2 [P,L] 

RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.svg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff))(index.php)?(.*) http://service.prerender.io/https://www.example.com/$3 [P,L] 

お知らせ(index.phpを)の追加? $ 2から$ 3への変更。また、www.example.comを自分のドメインに変更することを忘れないでください。

関連する問題