【问题标题】:Flash Object won't load as soon as I enter a Rewrite directive in .htaccess一旦我在 .htaccess 中输入重写指令,Flash 对象就不会加载
【发布时间】:2012-03-13 12:43:26
【问题描述】:

我的问题是我无法让 RewriteRule 工作。我有一个嵌入了 Flash 对象的 PHP 页面。我想要的是写一个规则来实现这一点:

http://mydomain.com/ 应该指向这个:

http://mydomain.com/AdServer.php

Flash 对象的所有参数(在查询字符串中,如果可用)也应该由 RewriteRule “复制”:

http://mydomain.com/?sessionId="dfdsfsdfsd"#code=d83285e9352d69b3a694fa4c9543db83

应该这样改写:

http://mydomain.com/AdServer.php?sessionId="dfdsfsdfsd"#code=d83285e9352d69b3a694fa4c9543db83

我在我的 .htaccess 文件中写了这个:

RewriteEngine on

RewriteRule ^(.*)$ AdServer.php

现在,最大的问题是,flash 对象根本没有加载。

谁能帮帮我?

非常感谢您。

大卫

这是我用来在页面中嵌入 Flash 对象的代码:

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

if ( hasProductInstall && !hasRequestedVersion ) {
    // DO NOT MODIFY THE FOLLOWING FOUR LINES
    // Location visited after installation is complete if installation is required
    var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
    var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;

    AC_FL_RunContent(
        "src", "playerProductInstall",
        "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
        "width", "<?=WIDTH ?>",
        "height", "<?=HEIGHT ?>",
        "align", "middle",
        "id", "AdServer",
        "quality", "high",
        "bgcolor", "#555555",
        "name", "AdServer",
        "allowScriptAccess","sameDomain",
        "type", "application/x-shockwave-flash",
        "pluginspage", "http://www.adobe.com/go/getflashplayer"
    );
} else if (hasRequestedVersion) {
    // if we've detected an acceptable version
    // embed the Flash Content SWF when all tests are passed
    AC_FL_RunContent(
            "src", "AdServer",
            "width", "<?=WIDTH ?>",
            "flashVars", "str=<?=$dataArray?>",
            "height", "<?=HEIGHT ?>",
            "align", "middle",
            "id", "AdServer",
            "quality", "high",
            "bgcolor", "#555555",
            "name", "AdServer",
            "allowScriptAccess","sameDomain",
            "type", "application/x-shockwave-flash",
            "pluginspage", "http://www.adobe.com/go/getflashplayer"
    );
  } else {  // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be placed here. '
    + 'This content requires the Adobe Flash Player. '
    + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
    document.write(alternateContent);  // insert non-flash content
  }
// -->
</script>


<noscript>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
            id="AdServer" width="<?=WIDTH ?>" height="<?=HEIGHT ?>"
            codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
            <param name="movie" value="AdServer.swf" />
            <param name="quality" value="high" />
            <param name="bgcolor" value="#555555" />
            <param name="bgcolor" value="#555555" />
            <param name="flashVars" value="str=<?=$dataArray?>" />
            <param name="allowScriptAccess" value="sameDomain" />

            <embed src="AdServer.swf" quality="high" bgcolor="#555555"
                width="<?=WIDTH ?>" height="<?=HEIGHT ?>" name="AdServer" align="middle"
                play="true"
                loop="false"
                flashVars="str=<?=$dataArray ?>"
                quality="high"
                allowScriptAccess="sameDomain"
                type="application/x-shockwave-flash"
                pluginspage="http://www.adobe.com/go/getflashplayer">
            </embed>
    </object>
</noscript>

【问题讨论】:

  • 你能提供你的flash的嵌入代码吗

标签: php flash .htaccess


【解决方案1】:

也许你在这里忘记了.swf

} else if (hasRequestedVersion) {
    // if we've detected an acceptable version
    // embed the Flash Content SWF when all tests are passed
    AC_FL_RunContent(
            "src", "AdServer.swf",

【讨论】:

  • 您好,我添加了 .swf。 swf 有时,但并不总是加载。但现在看来,我的 PHP 服务(我从 Flex 调用的 - flash 对象)不再工作了。
  • @TouchofDestiny $dataArray 返回什么
  • $dataArray 实际上是一个 base64 编码的字符串(对不起,名字不好)。
  • @TouchofDestiny PHP 服务的 url 是什么
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-07-31
  • 2020-07-15
  • 2017-05-24
  • 1970-01-01
  • 1970-01-01
  • 2019-05-13
  • 2021-09-06
相关资源
最近更新 更多