[solved] mod_rewrite errors (clean URLs)

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.
Post Reply
Jonny
Forum Members
Forum Members
Posts: 77
Joined: Sun Sep 24, 2006 10:49 am

[solved] mod_rewrite errors (clean URLs)

Post by Jonny »

[problem]

I'm attempting to set up a siteto use clean URLS, and have followed the instructions for both .htaccess and config.php.

Here's the .htaccess of the root directory (the site is installed within a directory named "site")

Options +FollowSymLinks
RewriteEngine on
RewriteBase /site/

# 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 [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

And the config.php URL settings:

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '/';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';

Attempting to access the site results in a 500 Internal Server Error and the server log returns four instances of the following error:

RewriteCond: bad argument line '%{REQUEST_URI}\xca!/$'\n

mod_rewrite is active on the server.

Any ideas?

[solution]

The problem lay in the space characters introduced by copying from the CMSMS site and pasting in to my .htaccess file. Backspacing over and re-entering the spaces did the job.
Last edited by Jonny on Fri Jan 26, 2007 4:14 pm, edited 1 time in total.
Post Reply

Return to “CMSMS Core”