mod_rewrite problem

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
pjk

mod_rewrite problem

Post 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]
Last edited by pjk on Wed Sep 20, 2006 3:00 pm, edited 1 time in total.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: mod_rewrite problem

Post 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?
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: mod_rewrite problem

Post 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.
pjk

Re: mod_rewrite problem

Post 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.
pixelpeter
New Member
New Member
Posts: 6
Joined: Wed Sep 20, 2006 8:50 pm

Re: mod_rewrite problem

Post 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
pjk

Re: mod_rewrite problem

Post 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?
Locked

Return to “CMSMS Core”