![](/img/trans.png)
[英]404 after moving site from linux/apache to windows2008/iis7
[英]Link error on IIS7 after a migration from Apache
我將PHP應用程序從Apache遷移到IIS7,所有鏈接均從包含路徑目錄的MySQL表記錄中加載。 我的PHP代碼和MySQL數據庫具有相同的結構。 但是,當我單擊鏈接時,PHP代碼不會執行,僅在我的主頁上有效。 我收到以下錯誤:
HTTP錯誤404.0-找不到
您要查找的資源已被刪除,名稱已更改或暫時不可用。
這是IIS配置問題嗎?
這是主頁:
<ul>
<?php
echo $class->menu->topmenu( $patharray[0] ) ?>
</ul>
以下是鏈接:
function topmenu ( $path = 'home' )
{
$home = $this->fetchOne ( $this->query( "SELECT * FROM admin_menu WHERE parent = 0" ) ) ;
$links = $this->fetch ( $this->query ( "SELECT admin_menu.*, aus.value FROM admin_menu LEFT JOIN admin_user_status aus ON ( aus.id = admin_menu.status ) WHERE parent = 1 AND active ='yes' ORDER BY sort ASC" ) ) ;
if ( $links )
foreach ( $links as $key => $link )
{
if ( $key == 0)
$url = '/';
else
$url = $link->url;
//if ( $link->priv == 'open' || ( $link->priv == 'private' && $this->userinfo->status == 225 ) )
if( $this->check_user_priv( $link ) )
{
if( stripos( $link->url, $path ) === false )
$result .= "<li class='mainlevel'><a href='$url' >$link->text</a></li>" ;
else
$result .= "<li class='mainlevel'><b><a href='$url' >$link->text</a></b></li>" ;
}
}
return $result;
}
上面的URL鏈接是從表中加載的,但是當我單擊它們時,我收到HTTP錯誤404.0-未找到。
我通過將Apache mod_rewrite規則導入IIS 7中的URL重寫模塊解決了我的問題。我從Apache進行的遷移具有.htaccess規則,需要將其轉換為web.config。 我希望這可以幫助其他人。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.