[SOLVED] about pretty url subdirectory or tree doesnt work.
[SOLVED] about pretty url subdirectory or tree doesnt work.
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?
#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.
Re: about pretty url subdirectory or tree doesnt work.
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
Ronny
Rename that to .htaccess in the root.
You might also try with modifying
toRewriteRule ^(.+)$ /index.php?page=$1 [QSA]
see the removal of the / infront.RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Ronny
Re: about pretty url subdirectory or tree doesnt work.
ok, i had my htaccess in to the root,
and i change the line (/) and anythings happened.
and i change the line (/) and anythings happened.
Re: about pretty url subdirectory or tree doesnt work.
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
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.
ok, ronny, so i put the htaccess.txt, in to my root
and delete the .htacceess of mi root?
thanks for your advice
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.
Re: about pretty url subdirectory or tree doesnt work.
no doesnot work, i put the htaccess.txt in to the root and rename for .htaccess.
and anything hapened.
thanks
and anything hapened.
thanks
Re: about pretty url subdirectory or tree doesnt work.
do you use single language version or mle?
Re: about pretty url subdirectory or tree doesnt work.
i have mle version
what its the difference?
what its the difference?
Last edited by cristianR on Tue Apr 27, 2010 10:40 pm, edited 1 time in total.
Re: about pretty url subdirectory or tree doesnt work.
For the CMS Made Simple Multilanguage version your .htaccess rewrite rule should be:
instead of
Code: Select all
RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA]
Code: Select all
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Re: about pretty url subdirectory or tree doesnt work.
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.
#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.
Re: about pretty url subdirectory or tree doesnt work.
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?
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.
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.
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.
Re: about pretty url subdirectory or tree doesnt work. SOLVED
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
Then it isn't a MLE version.... (or is not enable multilanguages)cristianR wrote: thanks everybody i solved my issue with this code
Alby