Page 1 of 1

[Solved] Pretty URLs with mod_rewrite, XP local install?

Posted: Sat Nov 29, 2008 1:45 am
by Piscator
I've followed the instructions in the CMSMS documentation and looked through relevant forum topics. I want to have pretty URLs of the form "/about.html" or "cars/ford.html" so that it presents like a static html site. But my attempts so far get a 404 error.

I've tried rebooting the server and clearing the CMSMS cache. I may be missing something obvious, especially in relation to how Apache works, which I don't fully understand, but hope you will bear with me.

CMSMS is a fresh install on an XP PC running "Uniform Server", and it runs fine. Details of the installation are: CMSMS 1.4.1, PHP 5.2.3, Server: Apache/2.0.59 (Win32) DAV/2 PHP/5.2.3, Database: MySQL (which seems to be working fine). It is installed in the folder www/cmcms.

I notice that the CMSMS System Information / Server Information includes "config_file: 0666 Failure", but don't know if it is relevant or important.

The settings I've tried are:

\cmsms\config.php
-------------------------
$config['internal_pretty_urls'] = false;
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.html';
$config['use_hierarchy'] = true;
-------------------------

Apache Server Config
-------------------------
AllowOverride All  - set in usr\local\apache2\conf\httpd.conf
-------------------------

.htaccess
-------------------------
## REWRITE DEFAULTS ###
RewriteEngine On
RewriteBase /cmsms/

# CMSMS Rewriting
  # Set assume mod_rewrite to true in config.php and clear CMSMS cache
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+)$ index.php?page=$1 [QSA]
  # END CMSMS
-------------------------

Thank you again for considering my request, any help you may be able to give will be much appreciated.

Regards to all,

Piscator

Re: Pretty URLs with mod_rewrite, XP local install?

Posted: Mon Dec 01, 2008 10:04 pm
by korpirkor
In httpd.conf you have to set:

Code: Select all

LoadModule rewrite_module modules/mod_rewrite.so
and another thing (.htaccess):

Code: Select all

RewriteBase /cmsms/
Replace /cmsms/ by your cms made simple installation directory.

Code: Select all

RewriteRule ^(.+)$ index.php?page=$1 [QSA]
page have to be set properly too.


ps. I use WampServer on windows and everything is OK :P

Re: Pretty URLs with mod_rewrite, XP local install?

Posted: Wed Dec 10, 2008 7:11 am
by Piscator
Thanks korpirkor, all is working fine now.  :)