Page 1 of 1

mod_rewrite problem

Posted: Wed Sep 20, 2006 2:57 pm
by pjk
I have tried to get my mod_rewrite working, but nothing happens. Maybe somebody could help?

I am using CMS Made Simple 1.0.1.

Below are my settings.

URL Settings: (config.php)

Code: Select all

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
.htaccess file

Code: Select all

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On

#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

Re: mod_rewrite problem

Posted: Wed Sep 20, 2006 3:08 pm
by tsw
pjk wrote: I have tried to get my mod_rewrite working, but nothing happens. Maybe somebody could help?
Nothing happens where? the urls are wrong, or is there a error?

running apache? or iis?

which version of php?

Re: mod_rewrite problem

Posted: Wed Sep 20, 2006 7:18 pm
by tsw
.htaccess file only affects after cmsms has calculated the new url in "pretty" style.

what if you test it with http://www.xxx.com/home.html does it show the right page?

have you cleared cache.

Re: mod_rewrite problem

Posted: Wed Sep 20, 2006 9:08 pm
by pjk
tsw wrote: .htaccess file only affects after cmsms has calculated the new url in "pretty" style.

what if you test it with http://www.xxx.com/home.html does it show the right page?

have you cleared cache.
404 Not Found

I cleared cache, but that didn't help.

Re: mod_rewrite problem

Posted: Wed Sep 20, 2006 9:47 pm
by pixelpeter
If you have access to your server-config (httpd.conf)
Add these values to your VirtualHost and you can see whats going on
during rewriting.
Remove these entries on a live site because of performance issues

RewriteLogLevel goes from  0 -9, 5 will be an good value to find the error

Code: Select all

RewriteLog /path/to/the/log/file
RewriteLogLevel 5

Re: mod_rewrite problem

Posted: Fri Sep 22, 2006 2:36 pm
by pjk
I have noticed that .htaccess -file isn't the problem. It seems that problem is that the software doesn't change URLs to the mod_rewrite form (xxx.html) but it leaves it like index.php?page=xxx. I tried CMSMS with mod_rewrite on other server and it worked fine. Could the problem be on the server?