亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    php偽靜態(tài)后html不能訪問怎么辦

    php偽靜態(tài)后html不能訪問的解決辦法:首先判斷文件是否存在;然后設(shè)置存在則不rewirte,不存在且符合規(guī)則才rewrite;最后修改htaccess文件即可。

    php偽靜態(tài)后html不能訪問怎么辦

    推薦:《PHP視頻教程》

    具體問題:

    PHP偽靜態(tài)后不能訪問純html文件

    .htaccess文件

    RewriteEngine on RewriteRule index.html$ index.php RewriteRule art.html$ project.php?file=art RewriteRule music.html$ project.php?file=music RewriteRule dance.html$ project.php?file=dance RewriteRule radio.html$ project.php?file=radio RewriteRule director.html$ project.php?file=director RewriteRule perform.html$ project.php?file=perform RewriteRule flight.html$ project.php?file=flight RewriteRule ([a-zA-Z]+)-([0-9]+).html$ page.php?pageid=$2 RewriteRule ([a-zA-Z]+)-([0-9]+)-([0-9]+).html$ page.php?pageid=$2&info=$3 RewriteRule ([a-zA-Z]+)-([0-9]+)-rules-(.*)-([a-zA-Z]+).html$ page.php?pageid=$2&info=$3&file=$4 RewriteRule ([a-zA-Z]+)-([0-9]+)-([0-9]+)-([a-zA-Z]+).html$ page.php?pageid=$2&menuid=$3&file=$4 RewriteRule ([a-zA-Z]+)-([0-9]+)-([a-zA-Z]+).html$ page.php?pageid=$2&file=$3 RewriteRule ([a-zA-Z]+)-([0-9]+)-([a-zA-Z]+)-list([0-9]+).html$ page.php?pageid=$2&file=$3&page=$4 RewriteRule ([a-zA-Z]+)-([0-9]+)-([0-9]+)-([a-zA-Z]+)-list([0-9]+).html$ page.php?pageid=$2&menuid=$3&file=$4&page=$5 RewriteRule ([a-zA-Z]+)-([0-9]+)-([0-9]+)-(.*)-([a-zA-Z]+).html$ page.php?pageid=$2&menuid=$3&artid=$4&file=$5

    而且我都已經(jīng)把 RewriteRule index.html$ index.php 這句去掉了 但打開的時(shí)候 還是反問偽靜態(tài)

    我現(xiàn)在要訪問網(wǎng)站里的純靜態(tài)HTML文件,同時(shí)又要求PHP的偽靜態(tài)也能訪問,怎么做?

    解決辦法:

    應(yīng)該先判斷文件是否存在,存在則不rewirte。不存在且符合規(guī)則才rewrite

    例如:文件或目錄不存在則rewrite到index.php,否則直接讀取存在的文件。

    <IfModule rewrite_module> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號