Pretty URL Error on hierarchical URLs
Posted: Tue Sep 18, 2007 2:44 pm
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.
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.