[SOLVED] about pretty url subdirectory or tree doesnt work.

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
cristianR
Forum Members
Forum Members
Posts: 30
Joined: Wed Apr 14, 2010 7:39 pm

[SOLVED] about pretty url subdirectory or tree doesnt work.

Post by cristianR »

well,  i try to display the pretty urls, with this code in, the .htaccess.

#Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteEngine on


# 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 ^(.+)$ /index.php?page=$1 [QSA]

and in the config.php

change the following lines,

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

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

$config['use_hierarchy'] = true;

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


and  the pretty urls works for the news and other pages.

but, the subdirectories or trees, example

info/page/information/ the pretty urls of (information) doesnot work

http://info/page/information.htm    ,

what i can do?
Last edited by cristianR on Mon May 03, 2010 5:13 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: about pretty url subdirectory or tree doesnt work.

Post by RonnyK »

Try the htaccess.txt that comes with the installation. It is to be found in the docs-folder.

Rename that to .htaccess in the root.

You might also try with modifying
RewriteRule ^(.+)$ /index.php?page=$1 [QSA]
to
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
see the removal of the / infront.
Ronny
cristianR
Forum Members
Forum Members
Posts: 30
Joined: Wed Apr 14, 2010 7:39 pm

Re: about pretty url subdirectory or tree doesnt work.

Post by cristianR »

ok,  i had my htaccess  in to the root,
and i change the line (/) and anythings happened.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: about pretty url subdirectory or tree doesnt work.

Post by RonnyK »

I know you have that .htaccess in the root, but I meant trying the default one coming with the installation.

That is named htaccess.txt and is in the doc-folder. When using that one, what happens?

Ronny
cristianR
Forum Members
Forum Members
Posts: 30
Joined: Wed Apr 14, 2010 7:39 pm

Re: about pretty url subdirectory or tree doesnt work.

Post by cristianR »

ok, ronny, so i put the htaccess.txt, in to my root
and  delete the .htacceess of mi root?

thanks  for your advice
Last edited by cristianR on Fri Apr 23, 2010 8:50 pm, edited 1 time in total.
cristianR
Forum Members
Forum Members
Posts: 30
Joined: Wed Apr 14, 2010 7:39 pm

Re: about pretty url subdirectory or tree doesnt work.

Post by cristianR »

no doesnot work, i put the htaccess.txt in to the root and rename for .htaccess.

and anything hapened.

thanks
uniqu3

Re: about pretty url subdirectory or tree doesnt work.

Post by uniqu3 »

do you use single language version or mle?
cristianR
Forum Members
Forum Members
Posts: 30
Joined: Wed Apr 14, 2010 7:39 pm

Re: about pretty url subdirectory or tree doesnt work.

Post by cristianR »

i have  mle version

what its the difference?
Last edited by cristianR on Tue Apr 27, 2010 10:40 pm, edited 1 time in total.
uniqu3

Re: about pretty url subdirectory or tree doesnt work.

Post by uniqu3 »

For the CMS Made Simple Multilanguage version your .htaccess rewrite rule should be:

Code: Select all

RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA]
instead of

Code: Select all

RewriteRule ^(.+)$ index.php?page=$1 [QSA]
cristianR
Forum Members
Forum Members
Posts: 30
Joined: Wed Apr 14, 2010 7:39 pm

Re: about pretty url subdirectory or tree doesnt work.

Post by cristianR »

Ok, now i have my code like this.


#Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteEngine on


# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
#RewriteCond %{REQUEST_METHOD} !POST$
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 ^(.+)$ /index.php?page=$1 [QSA]
RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA]

and in the config.php

change the following lines,

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

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

$config['use_hierarchy'] = true;

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



And does not work .

i need the solution , thanks for your advice.
Last edited by cristianR on Thu Apr 29, 2010 1:53 pm, edited 1 time in total.
uniqu3

Re: about pretty url subdirectory or tree doesnt work.

Post by uniqu3 »

did you try clearing CMSMS cache?
Or do you have any other rules in your .htaccess file? Try commenting the rules out to see if there is a problem with other rules.

Maybe try only with this rule to see if it works?

Code: Select all

<Files "config.php">
order allow,deny
deny from all
</Files>

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA]
cristianR
Forum Members
Forum Members
Posts: 30
Joined: Wed Apr 14, 2010 7:39 pm

Re: about pretty url subdirectory or tree doesnt work.

Post by cristianR »

no, i havent, more rules


my htacees is now like this.


order allow,deny
deny from all


RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA]

and the config


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

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

$config['use_hierarchy'] = true;

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


and doesnot work,

i dont know what else to do.

thanks for your coments.
Last edited by cristianR on Fri Apr 30, 2010 4:42 pm, edited 1 time in total.
cristianR
Forum Members
Forum Members
Posts: 30
Joined: Wed Apr 14, 2010 7:39 pm

Re: about pretty url subdirectory or tree doesnt work. SOLVED

Post by cristianR »


RewriteEngine on

RewriteBase /


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [QSA]


thanks everybody i solved my issue with this code

thanks for your advice.
alby

Re: about pretty url subdirectory or tree doesnt work. SOLVED

Post by alby »

cristianR wrote: thanks everybody i solved my issue with this code
Then it isn't a MLE version.... (or is not enable multilanguages)

Alby
Locked

Return to “[locked] CMSMS MLE fork”