書き換え mod の問題について議論する多くの質問があります。私はそれらを読みましたが、誰も私固有の問題を解決していません. 私はすでにそれを解決するために3時間の調査を行っていますが、まだ行き詰まっています.
file_get_contents()
PHP関数でリモートサイトから取得したソースコードのリンクを書き換えたい。
ソースコードを取得すると、リンク構造は次のようになります。
<a href='javascript:openWindow("index1.php?option=com_lsh&view=lsh&event_id=148730&tv_id=850&tid=34143&channel=0&tmpl=component&layout=popup&Itemid=335","735","770")' >Link#1</a>
私はそれを次のように書き換えたい:
<a href='javascript:openWindow("http://remotesite.com/index1.php?option=com_lsh&view=lsh&event_id=148730&tv_id=850&tid=34143&channel=0&tmpl=component&layout=popup&Itemid=335","735","770")' >Link#1</a>
いくつかの調査の後、mod を書き換えればうまくいくと思いました。以下のコードを .htaccess ファイルに入れようとしました:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index1\.php?option - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule http://remotesite/index1.php?option [L]
ただし、内部サーバーエラーが発生します。
ここで何が間違っていますか?上記の方法でリンク構造を書き換える他の方法はありますか?