Page 1 of 1

[Solved] url rewriting not active in menus

Posted: Fri Jan 08, 2010 2:44 pm
by maomaohuhu
Hi all, I have searched the forum with no luck.

Here is the situation: the "apache side" of url rewriting works. mod_rewrite is active, .htaccess works fine , as you can see with this re-written url : http://www.pmr-parador.be/entreprises.html

But the "CMSMS side" fails. The links in the menus still show a raw url , as you can see in the menu ( same link as above ).

I went by the doc here: http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s

$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';

I have cleared the cache in the admin - many times  :P

I see a {metadata} in the "gabarit" ( not sure what the naming convention is is english..... global layout maybe ? )

Version on CMSMS is 1.6.5

Since I have no previous experience with CMSMS, I am stuck at this point.

Help or direction would be greatly appreciated !

Thanks

Re: url rewriting not active in menus

Posted: Fri Jan 08, 2010 5:49 pm
by JeremyBASS
this is a little odd, what so you system info say?  also update to 1.6.6 too.. can you show us you .htaccess code... cheers Jeremy

Re: url rewriting not active in menus

Posted: Fri Jan 08, 2010 6:06 pm
by Dr.CSS
Hard coded or cms selflink or any other non menu manager menus are not going to be effected by mod_rewrite .htaccess...

Re: url rewriting not active in menus

Posted: Fri Jan 08, 2010 6:38 pm
by JeremyBASS
FWIW I know cms selflink link have converted for me... ... are they not suppost to  :o

Re: url rewriting not active in menus

Posted: Fri Jan 08, 2010 6:41 pm
by Dr.CSS
They should but it is acting like a link made by tiny that acts like hard coded links, the other advantage to using a menu manager template is getting the page active for links to style them different...

Re: url rewriting not active in menus

Posted: Sun Jan 10, 2010 3:27 pm
by maomaohuhu
JeremyBASS wrote: this is a little odd, what so you system info say?  also update to 1.6.6 too.. can you show us you .htaccess code... cheers Jeremy
thanks for the answer.

here is the htaccess:

Code: Select all

<IfModule mod_rewrite.c>
  	Options +FollowSymLinks
	RewriteEngine on
	RewriteBase /

	
  	# Redirection 301 de toutes les demandes qui ne contiennent 
	# pas un point ou un slash
	RewriteCond %{REQUEST_URI} !/$
	RewriteCond %{REQUEST_URI} !\.
	RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
	
	# Régles de réécriture pour la forme /parent/enfant/
	# mais réécrit seulement si l'URL demandée n'est pas un fichier ou un répertoire
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.+).html$ index.php?page=$1 [QSA]

</Ifmodule>


here is parts of the system info:

Code: Select all

Version du CMS

1.6.5

Modules installés

CMSMailer

1.73.14

FileManager

1.0.1

MenuManager

1.6.2

ModuleManager

1.3.1

News

2.10.3

nuSOAP

1.0.1

Printing

1.0.3

Search

1.6.1

ThemeManager

1.1.1

TinyMCE

2.5.4

 

process_whole_template:

false

max_upload_size:

48000000

default_upload_permission:

664

assume_mod_rewrite:

true

page_extension:

.html

internal_pretty_urls:

false

use_hierarchy:

true

debug:

false

output_compression:

false

Looking back at this, I guess the "internal_pretty_urls: false " stands out... But as far as I understand, it is the regular setting when mod_rewrite is used , am I wrong ?

here is the config.php settings:

Code: Select all

$config['url_rewriting'] = 'mod_rewrite';

$config['page_extension'] = '.html';

$config['use_hierarchy'] = true;

$config['query_var'] = 'page';
For now, I would prefer not to upgrade to 1.6.6. This doesn't look like a version issue does it ... As I mentionned, I don't have any experience with CMSMS. It is not even my website, I was just asked to fix this bug. So I would prefer not to change things if it is not necessary...

Re: url rewriting not active in menus

Posted: Sun Jan 10, 2010 3:42 pm
by RonnyK
Please check first if the pages you see in your menu are placed there with the {menu} tag or are hardcoded... I do think that you have coded page-calls there, and they are NOT taken then in the url-rewrite.

Ronny

Re: url rewriting not active in menus

Posted: Sun Jan 10, 2010 3:58 pm
by maomaohuhu
Dr.CSS wrote: Hard coded or cms selflink or any other non menu manager menus are not going to be effected by mod_rewrite .htaccess...
That's my opinion too.

OKKKK, indeed the links were hardcoded !

I had thought about this from the start, but I was mislead because I was looking at the wrong template. ( I still don't understand where are the settings that tells which template is used ).
I thought the "default template" was used, but by comparing the templates and the rendered code, I found the template used was different, and indeed, the links were hard-coded in that one !

Thanks Ronny, and thanks to all of you of you for the help !

Re: [Solved] url rewriting not active in menus

Posted: Sun Jan 10, 2010 4:09 pm
by RonnyK
To see what template is used. Click Content -> Pages, the column next to the name of the page shows the template used for that page.... While editing a page, the options-tab is the place to attach another template to the page.

Ronny