1

我的网站网页出现意外的 403 错误。我最近根本没有对我的网站进行任何更改,而且我不知道错误来自哪里。出现错误的页面是重定向到 mediafire(或其他下载源)链接并更新我的数据库中的下载计数的页面。仅当我的 url 中的重定向参数包含 http:// 时,才会发生该错误。

关于如何解决这个问题的任何想法?

下载.php:

<?php
    if(isset($_GET['uri'])){
        $download_link = $_GET['uri'];
        $download_link = str_replace("///","//",$download_link);


        $ip = $_SERVER['REMOTE_ADDR'];
        include "include/mysql_connect.php";

        $sql = "SELECT trackid FROM customs WHERE download='$download_link'";
        $res = mysql_query($sql);

        if(mysql_num_rows($res) == 1) {
            while($row = mysql_fetch_array($res)){
                $trackid = $row['trackid'];
            }
        }

        else{
            echo "<script type=\"text/javascript\">
    window.location = \"index.php\";
</script>";
            return;
        }

        if($trackid != ""){
            $query = mysql_query("SELECT * FROM downloads WHERE song='$trackid'");
            if (!$query or mysql_num_rows($query) == 0) {
                //If it doesn't exist, create the row
                $t = mysql_query("INSERT INTO downloads SET song='$trackid', count=1, date=NOW()");
            } else {
                //If it does, add one to the counter
                $t = mysql_query("UPDATE downloads SET count=count+1, date=NOW() WHERE song='$trackid'");
            }
        }

        echo "<script type=\"text/javascript\">
    window.location = \"$download_link\"
</script>";
    }

    else{
        echo "<script type=\"text/javascript\">
    window.location = \"index.php\";
</script>";
    }
?>

.htaccess (对此 download.php 没有任何规则。):

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

Redirect /unsubscribe http://ttrcustoms.us/#account=edit
Redirect /cydia http://repo.ttrcustoms.us
Redirect /Cydia http://repo.ttrcustoms.us
Redirect /repo http://repo.ttrcustoms.us
Redirect /tools http://tools.ttrcustoms.us

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^repo/deb/(.*)\.deb$ /download.php?package=$1.deb [L,QSA]
RewriteRule ^(.*\.(?:jpe?g|gif|png|bmp)$) /include/retinaimages.php?img=$1 [L]
4

0 回答 0