Page 1 of 1

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

Posted: Fri Apr 23, 2010 4:39 pm
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?

Re: about pretty url subdirectory or tree doesnt work.

Posted: Fri Apr 23, 2010 5:22 pm
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

Re: about pretty url subdirectory or tree doesnt work.

Posted: Fri Apr 23, 2010 7:15 pm
by cristianR
ok,  i had my htaccess  in to the root,
and i change the line (/) and anythings happened.

Re: about pretty url subdirectory or tree doesnt work.

Posted: Fri Apr 23, 2010 8:08 pm
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

Re: about pretty url subdirectory or tree doesnt work.

Posted: Fri Apr 23, 2010 8:43 pm
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

Re: about pretty url subdirectory or tree doesnt work.

Posted: Mon Apr 26, 2010 3:03 pm
by cristianR
no doesnot work, i put the htaccess.txt in to the root and rename for .htaccess.

and anything hapened.

thanks

Re: about pretty url subdirectory or tree doesnt work.

Posted: Mon Apr 26, 2010 3:14 pm
by uniqu3
do you use single language version or mle?

Re: about pretty url subdirectory or tree doesnt work.

Posted: Mon Apr 26, 2010 3:26 pm
by cristianR
i have  mle version

what its the difference?

Re: about pretty url subdirectory or tree doesnt work.

Posted: Wed Apr 28, 2010 8:59 am
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]

Re: about pretty url subdirectory or tree doesnt work.

Posted: Thu Apr 29, 2010 1:40 pm
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.

Re: about pretty url subdirectory or tree doesnt work.

Posted: Thu Apr 29, 2010 3:23 pm
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]

Re: about pretty url subdirectory or tree doesnt work.

Posted: Thu Apr 29, 2010 7:54 pm
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.

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

Posted: Mon May 03, 2010 5:08 pm
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.

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

Posted: Mon May 03, 2010 7:15 pm
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