CMS 1.4.1 + MLE - Pretty URLs problems

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
tomruss
New Member
New Member
Posts: 6
Joined: Thu Nov 13, 2008 7:32 pm

CMS 1.4.1 + MLE - Pretty URLs problems

Post by tomruss »

Hi!

I am running a fresh installation of 1.4.1 CMS with MLE added. It is working fine as long as I am using standard urls with query strings. When I switch to pretty urls - I can't get it working properly, only one language version is displayed when clicking on flags although the url changes. I have played a lot with mod_rewrite and other various settings, I've red all related post on this forum but the problem persist. What am I missing here. Any help is very welcomed.
You can see the page at http://lookbook.nazwa.pl/personalstylist2/

Following are my settings. Releveant section of php.config:

Code: Select all

#------------
#URL Settings
#------------
$config['assume_mod_rewrite'] = true;

$config['page_extension'] = '/';

$config['internal_pretty_urls'] = true;

$config['use_hierarchy'] = true;

$config['query_var'] = 'page';
.htaccess

Code: Select all

# Read FAQ: http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs also
Options +FollowSymLinks
RewriteEngine on
# Change to RewriteBase /cms/ if CMSMS is installed in this subdirectory
RewriteBase /personalstylist2/

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# COMMENT Monolingual rule and UNCOMMENT MLE rule
#RewriteRule ^(.+)$ index.php?page=$1 [QSA]
RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA] 
config_lang.php

Code: Select all

<?php
define('DEFAULT_LANG', 'pl_PL');

$hls = array(

 'en_US' => array(
	'block'=>'en',
	'flag'=>'<img src="/personalstylist2/images/lang/us.png" style="border:0; opacity:1;" alt="English" />',
	'text'=>'English',
 ),
 'pl_PL' => array(
	'block'=>'pl',
	'flag'=>'<img src="/personalstylist2/images/lang/pl.png" style="border:0; opacity:1;" alt="Polski" />',
	'text'=>'Polski',
	'locale'=>'pl_PL.utf8@euro',
 ),

);
?> 
alby

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by alby »

tomruss wrote: I have played a lot with mod_rewrite and other various settings, I've red all related post on this forum but the problem persist. What am I missing here. Any help is very welcomed.
Very strange.
Try with an empty $config['page_extension']
This is a mod_rewrite problem bacause work if you use:
http://lookbook.nazwa.pl/personalstylis ... p?hl=pl_PL
http://lookbook.nazwa.pl/personalstylis ... p?hl=en_US


Alby
tomruss
New Member
New Member
Posts: 6
Joined: Thu Nov 13, 2008 7:32 pm

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by tomruss »

Thanks for your answer.
alby wrote: Try with an empty $config['page_extension']
I tried both ways. I also tried toggling hierarchy setting. No luck.
Yes, I also suspect mod_rewrite settings but I have no clue what could be wrong with them. It looks like they are working partially correct translating contents of the second brackets to "page=something"...
It works also with deeper level subpages but somehow it still omitts the "hl=lang" part.

One strange thing I noticed:
1. http://lookbook.nazwa.pl/personalstylist2/en_US/home
This loads english home page but clicking on a polish flag (or changnig en_US --> pl_PL in url string for that matter) DOES NOT work.
2. However, having loaded the above and changnig url to http://WWW.lookbook.nazwa.pl/personalst ... pl_PL/home successfully loads polish version of the homepage. Than clicking on a US flag (points to http://lookbook.nazwa.pl/personalstylist2/en_US/home) works once and then we are back to point 1. again.
Looks like some browser/serwer caching related issue... I need to look into this more carefully but please if anyone have an solution or hint at least - do not hesitate to help me :)
Last edited by tomruss on Thu Nov 13, 2008 10:40 pm, edited 1 time in total.
tomruss
New Member
New Member
Posts: 6
Joined: Thu Nov 13, 2008 7:32 pm

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by tomruss »

OK. I fixed it. The problem was trivial as usual - .htaccess file was in the wrong place :)

Another question I have:
how to change "en_US" or "pl_PL" to simply "en" or "pl" in url string ? So it looks like e.g. www.page.com/en/page/ ?
alby

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by alby »

tomruss wrote: OK. I fixed it. The problem was trivial as usual - .htaccess file was in the wrong place :)

Another question I have:
how to change "en_US" or "pl_PL" to simply "en" or "pl" in url string ? So it looks like e.g. www.page.com/en/page/ ?
Have you seen config_lang.php.alby.label ?
BUT remember of clean your cookie browser for your site

Alby
unnamed7
Forum Members
Forum Members
Posts: 42
Joined: Tue Dec 05, 2006 1:53 pm

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by unnamed7 »

hi, i have the same problem with my installation of cms, what did u do to make it work ? where should be that .htaccess file if not in root of page ?

please help.
tomruss
New Member
New Member
Posts: 6
Joined: Thu Nov 13, 2008 7:32 pm

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by tomruss »

I put it in the personalstylist2 directory since this will be the actual root for my page. I am not using any redirection.
alby

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by alby »

unnamed7 wrote: hi, i have the same problem with my installation of cms, what did u do to make it work ? where should be that .htaccess file if not in root of page ?
Always in root of your cms installation and check if you have mod_rewrite enabled

Alby
remo
New Member
New Member
Posts: 7
Joined: Wed Jul 16, 2008 9:08 pm

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by remo »

Hi guys. Iam facing the similar problem that Tomruss mentioned but I placed the .htaccess file in the cmsms installed root. You can see the page at http://mavensoft.org/stepone/&nbsp; when the URL settings are changed to

Code: Select all

$config['assume_mod_rewrite'] = false;
$config['page_extension'] = '';
$config['internal_pretty_urls'] = true;
$config['use_hierarchy'] = false;
$config['query_var'] = 'page';
everything seems to work fine, but this wont work when

Code: Select all

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.html';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
and my .htaccess file

Code: Select all


  Options +FollowSymLinks
  RewriteEngine on
  #RewriteBase /
  #/var/log/httpd/rewrite_log
 
  # 301 Redirect all requests that don't contain a dot or trailing slash to
  # include a trailing slash
  # RewriteCond %{REQUEST_URI} !/$
  # RewriteCond %{REQUEST_URI} !\.
  # RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
 
  # Rewrites urls in the form of /parent/child/
  # but only rewrites if the requested URL is not a file or directory
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+).html$ index.php?page=$1 [QSA] 

Only one flag is clickable and that too changes nothing although the url changes.

please help me.

also please help me how can i have different menu (depending on language) using the same template.

thanks in advance and eagerly waiting for some replies
Last edited by remo on Mon Dec 01, 2008 12:45 pm, edited 1 time in total.
alby

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by alby »

remo wrote: and my .htaccess file
You not use htacess for MLE, view htaccess.mle in doc folder

remo wrote: also please help me how can i have different menu (depending on language) using the same template.
I don't understand, menu is automatic in every language.
Do you want another template for every language?

Alby
remo
New Member
New Member
Posts: 7
Joined: Wed Jul 16, 2008 9:08 pm

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by remo »

Thanks alby.It worked like a charm.
Coming to the menu thing I sorted it out.
phreerider
Forum Members
Forum Members
Posts: 24
Joined: Wed Dec 31, 2008 9:16 pm

Re: CMS 1.4.1 + MLE - Pretty URLs problems

Post by phreerider »

I want it to be www.niha.ca/en/ and www.niha.ca/fr/ rather than www.niha.ca/en_US/ or www.niha.ca/fr_FR/ - How do I do that?

*UPDATE: Nevermind my question, I've got it working!*
Last edited by phreerider on Mon Jan 12, 2009 9:22 am, edited 1 time in total.
Locked

Return to “[locked] CMSMS MLE fork”