ホームページ  >  記事  >  PHPフレームワーク  >  yiiindex.phpの隠し設定方法

yiiindex.phpの隠し設定方法

藏色散人
藏色散人オリジナル
2020-07-04 10:18:113144ブラウズ

Yii Index.php の隠し設定方法: まず、Apache の書き換えモジュールを有効にし、書き換え前に「#」記号を削除し、次に「.htaccess」ファイルを作成し、最後に yii 設定ファイル「mail.php」を変更します。 php「その通りです。

yiiindex.phpの隠し設定方法

#yii Hideindex.php

まず、Apacheの書き換えモジュールを開きます

以下に示すように、書き換える前に # を削除します。

    LoadModule rewrite_module modules/mod_rewrite.so

次に、yii のindex.php と同じディレクトリに、次の内容の .htaccess ファイルを作成します。

    <IfModule mod_rewrite.c>   
    Options +FollowSymLinks 
    IndexIgnore */* 
    RewriteEngine on  
    # if a directory or a file exists, use it directly 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d  
    # otherwise forward it to index.php 
    RewriteRule . index.php  
    </IfModule>

最後に、

      &#39;urlManager&#39;=>array(
       &#39;urlFormat&#39;=>&#39;path&#39;,
       &#39;showScriptName&#39;=>false,
       &#39;rules&#39;=>array(
      &#39;<controller:\w+>/<id:\d+>&#39;=>&#39;<controller>/view&#39;,
      &#39;<controller:\w+>/<action:\w+>/<id:\d+>&#39;=>&#39;<controller>/<action>&#39;,
      &#39;<controller:\w+>/<action:\w+>&#39;=>&#39;<controller>/<action>&#39;,
     ),
  ),

を yii 設定ファイル mail.php に追加します。これにより、index.php

が非表示になります。 「

yii チュートリアル >>

以上がyiiindex.phpの隠し設定方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。