[Codeigniter-users] .htaccessのRewriteの書き方について

Back to archive index

Oono Tomoyuki tomoy****@tabim*****
2011年 6月 14日 (火) 09:36:41 JST


大野です。

> RewriteRule ^(.*)$ /index.php/$1 [L]
は、
RewriteRule ^(.*)$ ./index.php/$1 [L]
でどうでしょうか?


2011年6月14日9:11  <list****@aladd*****>:
> お世話になっております、
> 安川@大阪市です。
>
> 仕事の関係で、初めてのレンタルサーバ(K●●I)にCodeigniterで
> 実装する事になったのですが、Rewriteでハマっております。
>
> Codeigniterそのものではなく、Apacheの話題が強い事を
> ご容赦ください。
>
> 【1】
> .htaccessを以下のように記述し、
> http://example.com/foo/bar/とアクセスすると、
> classとfunctionが取得できていません。
> http://example.com/index.php/foo/bar/とアクセスすると
> 正常に動作します。
>
> Options +FollowSymLinks
>
> RewriteEngine on
> RewriteBase /
> RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico|(.*).jpg|(.*).gif|(.*).css|(.*).js|(.*).swf)
> RewriteRule ^(.*)$ /index.php/$1 [L]
>
> 【2】
> また、以下のように記述し、
> http://example.com/foo/bar/とアクセスすると、
> 正常に動作します。
> (※http://example.com/index.php/foo/bar/にリダイレクトされています。)
>
> Options +FollowSymLinks
>
> RewriteEngine on
> RewriteBase /
> RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico|(.*).jpg|(.*).gif|(.*).css|(.*).js|(.*).swf)
> RewriteRule ^(.*)$ http://example.com/index.php/$1 [L]
>
>
> 【2】はリダイレクトされているので、URL的には正しい動きになっていると
> 推測できますが、リダイレクトのため、POSTの値が取れません。
>
> 【1】で動かす必要があるのかと思うのですが、
> ここで考えられる事、また、確認方法、対処方法等ございましたら、
> ご教授いただければ幸いです。
>
>
> --o--o--o--o--o--o--o--o--o
> Yasukawa @大阪
> list****@aladd*****
>
> _______________________________________________
> Codeigniter-users mailing list
> Codei****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/codeigniter-users
>




Codeigniter-users メーリングリストの案内
Back to archive index