/modules/ changerのテスト中

Date 2005-05-16 12:11:34 | Category: Site News

in englishin japanese
Simplified URL をいろいろ試しましたが、どうしても副作用を消しきれない、というのが正直なところです。

というわけで、もっとずっとお手軽な「modules を好きな文字列に変更する」てなHackを試してます。

パスの深さという、非常に面倒な問題は変わらないので、副作用もほとんどないのではないか、と見積もっています。しばらくこのサイトでテストしてみます。

insert 8 lines into top of mainfile.php

	// modules changer (insert this 8 lines)
	if( ! function_exists( 'modules_changer' ) ) {
		$_SERVER['REQUEST_URI'] = str_replace( '/md/' , '/modules/' , @$_SERVER['REQUEST_URI'] ) ;
		$_SERVER['HTTP_REFERER'] = str_replace( '/md/' , '/modules/' , @$_SERVER['HTTP_REFERER'] ) ;
		function modules_changer( $s ) {
			return str_replace( XOOPS_URL.'/modules/' , XOOPS_URL.'/md/' , $s ) ;
		}
		ob_start( 'modules_changer' ) ;
	}


insert 2 lines into XOOPS_ROOT_PATH/.htaccess

RewriteEngine on
RewriteRule ^md/(.*)$ modules/$1 [L]

2005/5/27追記:

深いリファラチェックを行ういくつかのモジュールのために、$_SERVER['HTTP_REFERER'] についても、書き換えを行うようにしました。

(Protector や WordPressME 0.3x がそれに該当します)

2007/2/18追記:
mainfile.phpの二度読みするモジュールへの対策を入れてみました



You can read more news at PEAK XOOPS.
http://xoops.peak.ne.jp

The URL for this story is:
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=54