[SOLVED] Pretty url , cms_selflink start and mod_rewrite

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
vinc
Forum Members
Forum Members
Posts: 26
Joined: Thu Jun 14, 2007 10:01 am

[SOLVED] Pretty url , cms_selflink start and mod_rewrite

Post by vinc »

Hi there,

I'm quite new to mod_rewrite so help wanted to solve my little problem !

Everything is fine with pretty urls except the link generated from :

Code: Select all

{cms_selflink dir=start text="Home"}
which become a ugly link :

Code: Select all

http://www.mysite.tld/?hl=en
I think I'm using the right rule in .htaccess (this works on every other pages/links)

Code: Select all

RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA]
All I want is to have a link like :

Code: Select all

http://www.mysite.tld/en/
Do you think it is possible ? (I assume yes...)
But how can I do this ? Using mod_rewrite ?

Thanks in advance !
Vincent

PS : Last thing : Thank you Alby, all the ressources from the forum are very useful (tips, howto...)
Last edited by vinc on Wed Jan 13, 2010 10:41 am, edited 1 time in total.
Peciura

Re: Pretty url , cms_selflink start and mod_rewrite

Post by Peciura »

I am not using pretty url, but have you tried to add

Code: Select all

RewriteRule ^(.*)/$ index.php?hl=$1 [QSA]
or

Code: Select all

RewriteRule ^(.*)$ index.php?hl=$1 [QSA]
?
Last edited by Peciura on Thu Dec 17, 2009 11:14 pm, edited 1 time in total.
vinc
Forum Members
Forum Members
Posts: 26
Joined: Thu Jun 14, 2007 10:01 am

[SOLVED] : Pretty url , cms_selflink start and mod_rewrite

Post by vinc »

Hi Alby,

Yes I tried the htaccess way, but no luck with it...

I found another way modifying the files :
/plugins/function.lang.php

Code: Select all

... line 55 ...
//$_url = $config['root_url'].'/?hl=';
  $_url = $config['root_url'].'/';

... line 67...
//$arr_mle[$key]['link'] = (isset($_end_url)) ? $config['root_url'].'/'.$key.'/'.$_end_url : $_url.$key;
  $arr_mle[$key]['link'] = (isset($_end_url)) ? $config['root_url'].'/'.$key.'/'.$_end_url : $_url.$key.'/';
and the same near lines 76,88 and 95,106
/lib/classes/class.content.inc.php

Code: Select all

... line 1570 ...
//$url = $config['root_url'].'/'."?hl=$hl";
  $url = $config['root_url'].'/'."$hl".'/';
Feel free to comment all of this stuff...

Happy new year to all CMSMS team and contributors ;)
Last edited by vinc on Wed Jan 13, 2010 10:42 am, edited 1 time in total.
Locked

Return to “[locked] CMSMS MLE fork”