サブディレクトリの下にyiiウェブサイトがあります。
http://localhost/~username/maindirectory/yiiapp/
私のhtaccessファイル:
DirectoryIndex index.php index.html index.htm
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /yiiapp
# 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>
保護された/config/main.php
...
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
....
問題:
私がアクセスするとしましょう:
- 第一歩:
http://localhost/~username/maindirectory/yiiapp/
- ステップ 2: ホームページ (デフォルトの yii アプリ) の任意のリンクをクリックし
About Us
ます。 - ステップ 3:
http://localhost/~username/maindirectory/yiiapp/site/page?view=about
- ステップ4:リンクのいずれかをクリックします(同じページとしましょう)
- URL は次のようになります。
http://localhost/yiiapp/site/page?view=about
したがって、すべてのリンクは : としてアクセスできます。リンク http://localhost/yiiapp/....
から index.php を削除する代わりに、文字列 b/wlocalhost
とベース ディレクトリが削除されます。
私はすでにこれを試しましたが、明らかにサブドメインを使用せずに、 localhost に同じ種類の URL が必要です
これを修正するのを手伝ってください。