PEAK XOOPS - mod_rewriteでのコメント投稿 in englishin japanese

mod_rewriteでのコメント投稿

List posts in the topic

question mod_rewriteでのコメント投稿

msg# 1
depth:
0
Previous post - Next post | Parent - Children.1 .2 | Posted on 2006/4/20 13:43
t_yamo  二等兵   Posts: 7
はじめまして。TinyD2.21を利用させて頂いております。

現在、Aliasを使ったサイトに対してWRAP3でコメント可能なページを表示しようとしているのですが、コメントの投稿ボタンを押すと「rewrite/」が外れてしまい、投稿後のページがmod_rewriteによる変換を通さない形で表示されてしまいます。

この対応としてinclude/display.inc.php(TinyD2.21)の182行目に以下のコードを加え、以降の「$mod_url」を「$mod_url_rewrite」に変えたところ、投稿後も「rewrite/」が付くようになりました。

if( ! empty( $xoopsModuleConfig['tc_force_mod_rewrite'] ) || $tmp_array['link'] == TC_WRAPTYPE_USEREWRITE ) {
  $mod_url_rewrite = $mod_url . '/' . substr( $tc_rewrite_dir , 0, -1 ) ;
} else {
  $mod_url_rewrite = $mod_url ;
}

質問1:display.inc.phpを変更せずに投稿後も「rewrite/」が付くように設定することは可能でしょうか。

質問2:上記コードに問題点はありますでしょうか。

※以下に試行環境のhttpd.confの一部を記載します。
Alias /cms "C:\home\files\repo\xoops"
<Directory "C:\home\files\repo\xoops\modules\tinyd0">
  RewriteEngine on
  RewriteBase /cms/modules/tinyd0
  RewriteRule ^rewrite/tc_(.*).html$ index.php?id=$1 [L]
  RewriteRule ^rewrite/(.*.html?)$ rewrite.php?wrap=$1 [L]
  RewriteRule ^rewrite/index.php(.*)$ index.php$1 [L]
  RewriteRule ^rewrite/comment_new.php(.*)$ comment_new.php$1 [L]
  RewriteRule ^rewrite/comment_post.php(.*)$ comment_post.php$1 [L]
  RewriteRule ^rewrite/comment_reply.php(.*)$ comment_reply.php$1 [L]
  RewriteRule ^rewrite/comment_edit.php(.*)$ comment_edit.php$1 [L]
  RewriteRule ^rewrite/comment_delete.php(.*)$ comment_delete.php$1 [L]
  RewriteRule ^rewrite/(.*)$ content/$1 [L]
</Directory>
Windows Server 2003
Apache 2.0.55
PHP 4.2.2
XOOPS Cube 2.0.13a 日本語版
Votes:40 Average:8.25

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!