Forum Moderators: phranque

Message Too Old, No Replies

Problem in fckeditor integration with php due to htaccess

mod rewrite rules creating problem

         

phparion

11:17 am on Apr 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi

I am unable to integrate FCKeditor (WYIWYG) editor in my site due to the htaccess I am using for ModRewrite

first of all here is my htaccess rules overview

RewriteRule ^folder1/$ folder1/index.php [T=application/x-httpd-php]

RewriteRule ^([^.]+)/([^.]+)/([^.]+)\.html$ page1.php?id=$3 [T=application/x-httpd-php]

RewriteRule ^([^.]+)/([^.]+)/$ page2.php?s=$1&c=$2 [T=application/x-httpd-php]

the pages I am working on are in 'folder1' and the FCKeditor is installed under domain.com/folder1/FCKeditor

now the problem is that when the fckeditor.php is used to create the instance with this code

function __construct( $instanceName )
{
$this->InstanceName = $instanceName ;
$this->BasePath = '/folder1/FCKeditor/' ; // it is by default /fckeditor/
$this->Width = '400' ;
$this->Height = '400' ;
$this->ToolbarSet = 'Default' ;
$this->Value = '' ;

$this->Config = array() ;
}

skipping the long code here is the code that generates the LINK to call the FCKeditor html page which has all the rich text icons embedded in it

$Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;
//echo $Link;

it I echo this link I get

/folder1/FCKeditor/editor/fckeditor.html?InstanceName=page_body

just in case if you don't know the inner code of fckeditor here are the lines which are used to create the richtext editor in an INLINE FRAME

// Render the linked hidden field.
$Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;

// Render the configurations hidden field.
$Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ;

// Render the editor IFRAME.
$Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"yes\"></iframe>" ;

the page which is supposed to be shown in this inline frame is the one shown in the $Link above, but instead of that page the htaccess RULE 2 is standing true and the page2.php is shown in the inline frame.

I tried different htaccess settings but nothing is working, I was wondering if anybody could help me to solve this.

just to add I tried this rule

RewriteRule ^folder1/FCKeditor/([^.]+)$ controlroom/FCKeditor/$1 [T=application/x-httpd-php]

the logic is that read whatever path is after folder1/FCKeditor and redirect to that path but it is giving the same result of redirecting me to the page2.php though I write this new rule above the RULE 2 of the htaccess so that first this RULE is checked but it still skips the new rule and validates the RULE 2

RewriteRule ^([^.]+)/([^.]+)/([^.]+)\.html$ page1.php?id=$3 [T=application/x-httpd-php]

phparion

1:21 pm on Apr 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have solved this. thank you

jdMorgan

1:52 pm on Apr 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Off-topic, but your rules will probably run much more efficiently with corrected patterns:

RewriteRule ^([^/]+)/([^/]+)/([^.]+)\.html$ page1.php?id=$3 [T=application/x-httpd-php]
RewriteRule ^([^/]+)/([^/]+)/$ page2.php?s=$1&c=$2 [T=application/x-httpd-php]

Jim