Page 1 of 1

Pretty URL Error on hierarchical URLs

Posted: Tue Sep 18, 2007 2:44 pm
by yewang
CMSMS v1.1 / Apache 2.0 + mod_rewrite / PHP 4.3.8
I setup the site Pretty URL as directed by the CMS tutorial:

.htaccess File:
---------------------------------------
Options +FollowSymLinks
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 [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';
---------------------------------------

And I create a dummy page called test-page and place it under home. Whenever I access the page in this URL:
http://example.com/home/test-page, it will get me this weird error(5 times) on the top of the test-page:


Warning: Compilation failed: unrecognized character after (? at offset 11 in /data/www/www.example.com/index.php on line 120

Warning: Compilation failed: unrecognized character after (? at offset 11 in /data/www/www.example.com/index.php on line 120

Warning: Compilation failed: unrecognized character after (? at offset 11 in /data/www/www.example.com/index.php on line 120

Warning: Compilation failed: unrecognized character after (? at offset 11 in /data/www/www.example.com/index.php on line 120

Warning: Compilation failed: unrecognized character after (? at offset 11 in /data/www/www.example.com/index.php on line 120


If I access the test page without the hierarchical URL schema, enter it flat out as http://example.com/test-page, it works beautifully but that's not what I want thought, anyone can help me point out what's the culprit here?

Thanks a lot in advance.

Re: Pretty URL Error on hierarchical URLs

Posted: Tue Sep 18, 2007 7:18 pm
by Pierre M.
Hello,

try rather this one :
http://wiki.cmsmadesimple.org/index.php ... l_Settings
(the provided official .htaccess sample is shorter and more simple)

If you like hierarchical pretty URLs, you should like ".html" postfixes ("page_extension") too.

Pierre M.

Re: Pretty URL Error on hierarchical URLs

Posted: Wed Sep 19, 2007 9:55 pm
by yewang
Thanks Pierre, I followed the new tutorials you pointed out here. And nope, it still shows up with those warning error messages.

Is there a log I can look up to see what exactly was going on during the page URL process?
Pierre M. wrote: Hello,

try rather this one :
http://wiki.cmsmadesimple.org/index.php ... l_Settings
(the provided official .htaccess sample is shorter and more simple)

If you like hierarchical pretty URLs, you should like ".html" postfixes ("page_extension") too.

Pierre M.

Re: Pretty URL Error on hierarchical URLs

Posted: Thu Sep 20, 2007 1:14 pm
by Pierre M.
Try to add log about the rewriting process by inserting this at the beginning of the .htaccess :

Code: Select all

RewriteLog /path/to/the/file.log
RewriteLogLevel 5
You can set the log level from 0 to 9.

Pierre M.