list****@aladd*****
list****@aladd*****
2009年 7月 13日 (月) 16:57:47 JST
いつもお世話になっております安川です。 お返事が遅くなりまして申し訳ありません。 安藤様> ありがとうございます。 確かにclass名と判断されているようです。 以下の例のようにセッション部分の引数が無ければ正常に動くのですが、 セッション部分があるとそれをclass名と認識してしまうようです。 試しに、「m」ディレクトリ無しでも試してみましたが現象は同じでした。 携帯なので、出来る限り短いURLにしようと思っていましたので、最初の アクセスは「http://example.com/m/」に来て頂いて、それ以降、 システム側で作り出すURLはすべて 「http://example.com/m/shop/index/SESSID=xxxxxx」と省略しないように すれば、解決しそうです。 Kenji様> ありがとうございます。 > http://example.com/m/SESSID=xxxxxx > では、 > RewriteRule ^(.*)$ /m/index.php/$1 [L] > なので、 > http://example.com/m/index.php/SESSID=xxxxxx 「http://example.com/m/SESSID=xxxxxx」でアクセスされると、 .htaccessの「RewriteRule ^(.*)$ /m/index.php/$1 [L]」で、 「http://example.com/m/index.php/SESSID=xxxxxx」に変換され、 routes.phpの「$route ['(.*)/SESSID=.*$'] = "$1";」で、内部的に 「http://example.com/m/index.php」と認識され、この後に デフォルトのclassとfunctionが割当たると考えておりました。 システム側では、URLを省略しない形で、作成すれば、 このような問題には、ぶつからないので、省略しない形で 進めてみようと思っております。 【現象のサンプル】 [OK] http://example.com/m/shop/index/SESSID=xxxxxx [OK] http://example.com/m/shop/SESSID=xxxxxx [NG] http://example.com/m/SESSID=xxxxxx [OK] http://example.com/m/index.php/shop/index/SESSID=xxxxxx [OK] http://example.com/m/index.php/shop/SESSID=xxxxxx [NG] http://example.com/m/index.php/SESSID=xxxxxx [OK] http://example.com/m/shop/index/ [OK] http://example.com/m/shop/ [OK] http://example.com/m/ [OK] http://example.com/m/index.php/shop/index/ [OK] http://example.com/m/index.php/shop/ [OK] http://example.com/m/index.php --o--o--o--o--o--o--o--o--o Yasukawa @南船場inおおさか list****@aladd***** On Mon, 6 Jul 2009 17:43:50 +0900 Kenichi Ando <neo.k****@gmail*****> wrote: > 安川さん、こんにちは。 > 安藤です。 > > 下記ですが、CIのURIに関する基本事項: > > example.com/(index.php)/class/function/ID > > となています。 > 安川さんの作ったmディレクトリは、class名の「m」として認識 > されているのではないでしょうか? > > CIにおけるURIの仕組み: > http://codeigniter.jp/user_guide_ja/general/urls.html > > を今一度、ご一読ください。 > > そして、mディレクトリが無い状態で、携帯電話向けのクエリ文字 > アプローチが成功したのち、mディレクトリに進むのが良いかと > 思います。 > > //安藤 > > > 2009/07/06 17:01 に <list****@aladd*****> さんは書きました: > > いつもお世話になっております、安川です。 > > > > > > URIにSESSIDを付加させる > > http://codeigniter.jp/archives/91 > > > > 上記を参考に、携帯サイトの構築を進めようと考えております。 > > > > > > - config/config.phpでDBに変更する > > $config['sess_use_database'] = TRUE; > > $config['index_page'] = ""; // index.phpを削除 > > > > - URIセグメントパターンに「=」を追加します。 > > $config['permitted_uri_chars'] = '= a-z 0-9~%.:_-'; > > > > - config/routes.phpでルーティングを変更させます。 > > $route ['(.*)/SESSID=.*$'] = "$1"; > > $route['default_controller'] = "shop"; > > > > > > これら設定を行った後、http://example.com/m/というURLで > > アクセスさせるために、「m」ディレクトリ直下に.htaccsessを > > 以下のような内容で設置しました。 > > > > RewriteEngine on > > RewriteCond $1 !^(index\.php|img|) > > RewriteRule ^(.*)$ /m/index.php/$1 [L] > > > > そうしますと、以下のような現象が起こりました。 > > > > [OK] http://example.com/m/shop/index/SESSID=xxxxxx > > [OK] http://example.com/m/shop/SESSID=xxxxxx > > [NG] http://example.com/m/SESSID=xxxxxx > > > > NGは404 Not Foundになりました。 > > > > デフォルトのコントローラーがうまく取得できてないのかなと思うのですが、 > > 何かチェックポイント等ありますでしょうか。 > > > > > > 【環境】 > > Cent OS 5 > > Apache 2.2.10 > > PHP 5.2.9 > > CodeIgniter 1.6.3 > > > > --o--o--o--o--o--o--o--o--o > > Yasukawa @南船場inおおさか > > list****@aladd***** > > > > _______________________________________________ > > Codeigniter-users mailing list > > Codei****@lists***** > > http://lists.sourceforge.jp/mailman/listinfo/codeigniter-users > > > > > > -- > ---------------------------------------------------------------------------------------- > 株式会社 音生 > 安藤 建一 > 愛知県名古屋市中区金山5丁目11−6 > 名古屋ソフトウェアセンタービル1F > TEL : 052-884-0017 > FAX : 052-884-0018 > URL : http://neo-navi.net/ > ---------------------------------------------------------------------------------------- > > _______________________________________________ > Codeigniter-users mailing list > Codei****@lists***** > http://lists.sourceforge.jp/mailman/listinfo/codeigniter-users