What's the difference?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Moozie
Posts: 164
Joined: Sat 8. Nov 2003, 00:21
Location: Netherlands

What's the difference?

Post by Moozie »

Question 1:
What's the big difference between 1 = HTMLarea, and 2 = FCKeditor?

FCKeditor has style possibilities, but not a real big change. Or do I miss anything?

Question 2:
When I choose option 3: "browser based"... I still get the FCKeditor. Is that right?

Question 3:
$phpwcms["rewrite_url"] = 0; //whether URL should be rewritable
What does this mean: "whether URL should be rewritable"???
alwaysLearning
Posts: 5
Joined: Mon 26. Jan 2004, 02:32

Rewrite URL

Post by alwaysLearning »

Hi Moozie

I'm only a noob, but I just discovered the joys of rewrite_URL which I unsuccessfully struggled with in a number of other CMS's - PHPWCMS rocks !!!!

In your .htaccess file you need to add some lines to tell the server to display dynamic URLS as a static "looking" URL ... instead of http://www.yoursite.com/index.php?id=33,0,0,1,0,0 your visitors will see http://www.yoursite.com/33.0.0.1.0.0.html

More importantly Google will index your non-dynamic looking URL's with much more fervour !

It didn't work for me initially, but its now working great - my .htaccess file says this :

--------------------------------------------

RewriteEngine on
RewriteOptions MaxRedirects=6

RewriteRule ^index.html$ ./index.php [L]
RewriteRule ^(.*)\.(.*\.html$) $1,$2 [N]
RewriteRule ^(.*)\.html$ ./index.php?id=$1

php_flag magic_quotes_gpc Off
php_flag register_globals Off

----------------------------------------------

and there is a change I believe you need to make to the include/inc_front/front_func_inc.php file at line 1084 or thereabouts, to change it to be this :

//Rewrite functions
function url_search($query)
{
if(strpos($query, "id")) $noid = substr($query, 4);
else $noid = substr($query, 1);
$file = str_replace(",", ".", $noid).".html"; //further use
//$file = $noid.".html";
$link = "<a href=\"".$file."\"";
return($link);
//unset($link);
}

function js_url_search($query)
{
$noid = substr($query, 4);
$file = str_replace(",", ".", $noid).".html"; //further use
//$file = $noid.".html";
$link = "onClick=\"location.href='".$file."'";
return($link);
//unset($link);
}

---------------------------------

I changed that stuff above as per another post and all works lovely :-) Apologies to anyone if I kludged the fixes I've read about, and THANKS AGAIN OLIVER AND THE OPEN SOURCE COMMUNITY - THIS IS A TOP SHELF APPLICATION !!!!!!!!!!!!!!!!!
Assume I'm stupid and a newbie.
Then if I've accidentally said something intelligent above, it may come as a nice surprise to both of us.
;-)
Moozie
Posts: 164
Joined: Sat 8. Nov 2003, 00:21
Location: Netherlands

Post by Moozie »

Thanks now I understand the way of working.

2 things:

Thing 1:
Since Oliver added a variable called $cms["rewrite_url"] = 0 or 1, I believe that I can skip the change of this code that you mentioned:

So this can be skipped if you have that variable $cms["rewrite_url"]:

Code: Select all

and there is a change I believe you need to make to the include/inc_front/front_func_inc.php file at line 1084 or thereabouts, to change it to be this : 

//Rewrite functions 
function url_search($query) 
{ 
if(strpos($query, "id")) $noid = substr($query, 4); 
else $noid = substr($query, 1); 
$file = str_replace(",", ".", $noid).".html"; //further use 
//$file = $noid.".html"; 
$link = "<a href=\"".$file."\""; 
return($link); 
//unset($link); 
} 

function js_url_search($query) 
{ 
$noid = substr($query, 4); 
$file = str_replace(",", ".", $noid).".html"; //further use 
//$file = $noid.".html"; 
$link = "onClick=\"location.href='".$file."'"; 
return($link); 
//unset($link); 
} 

Thing 2:
In my /phpwcms dir if find a "_.htaccess" file (with underscore). If I adjust the file with your code, I get the error:

Code: Select all

Not Found
The requested URL was not found on this server. 
If I change the name to ".htaccess" I get an

Code: Select all

internal server error.

My file "_.htaccess" had the following content:

Code: Select all

php_flag magic_quotes_gpc Off
php_flag register_globals Off
I addes your lines, but nothing helps.



Maybe you have an older version of the program that contains a .htaccess file instead of _.htaccess (the underscore is usually used to disable the file I thought)...

Any clues on what is wrong. And how to enable the rewrite url?
alwaysLearning
Posts: 5
Joined: Mon 26. Jan 2004, 02:32

Rewrite URL

Post by alwaysLearning »

Hi Moozie

You are right - the latest version doesn't need most of the other hacks you can find when you search this forum. Mine stopped working due to some glorious stupidity on my part, so I had to reverse- engineer what I'd done.

Anyway, its seems to me in the current version, you simply turn on the Rewrite_URL variable
$phpwcms["rewrite_url"] = 1; //whether URL should be rewritable in include/inc_conf/conf.inc.php

That takes care of all the rewriting issues that are mentioned, so that change to code I mentioned is unnecessary as you suggested. There is also no need for one of the hacks mentioned for a previous version where you physically add the include/inc_rewrite/rewrite_url.php - I deleted that folder in its entirety this time round.

It then gave me 404 errors till I uploaded in ASCII mode the following .htaccess :

RewriteEngine on
RewriteOptions MaxRedirects=6

RewriteRule ^index.html$ ./index.php [L]
RewriteRule ^(.*)\.(.*\.html$) $1,$2 [N]
RewriteRule ^(.*)\.html$ ./index.php?id=$1

php_flag magic_quotes_gpc Off
php_flag register_globals Off

Its working fine. So I have no idea how or why, but its working :-) If you search the forum for "rewrite URL" you'll some people have had to try some different variations of the .htaccess file, and if you have access to httpd conf there are some techo things you can check. It probably depends on where you're hosting too, and whether the host has the mod_rewrite module enabled by default. But I'm out of my depth, so I hope someone else will jump in and help you :-)

Good luck
Carl
Assume I'm stupid and a newbie.
Then if I've accidentally said something intelligent above, it may come as a nice surprise to both of us.
;-)
Moozie
Posts: 164
Joined: Sat 8. Nov 2003, 00:21
Location: Netherlands

Post by Moozie »

I have mod_rewrite loaded on my server so it has to work.

But still:
If I set: $cms["rewrite_url"] = 0;
All works well.

And if I do:
$cms["rewrite_url"] = 1;
I see that the menu-buttons lead to a *.html page, but if I click I get "page not found" error.

Please any clues. It has to be something small I think.

Please help.
Post Reply