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.
Pretty URL Error on hierarchical URLs
Pretty URL Error on hierarchical URLs
Last edited by yewang on Tue Sep 18, 2007 2:49 pm, edited 1 time in total.
Re: Pretty URL Error on hierarchical URLs
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.
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
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?
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
Try to add log about the rewriting process by inserting this at the beginning of the .htaccess :
You can set the log level from 0 to 9.
Pierre M.
Code: Select all
RewriteLog /path/to/the/file.log
RewriteLogLevel 5
Pierre M.