Page 1 of 1

404 error when pretty urls are used (SOLVED)

Posted: Mon Oct 15, 2012 7:54 am
by Dave59
Goodmorning
I am using 1.11.2.
My cofig:

Code: Select all

<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['dbms'] = 'mysqli';
$config['db_hostname'] = '*******.1and1.com';
$config['db_username'] = '*********';
$config['db_password'] = '**********';
$config['db_name'] = '************';
$config['db_prefix'] = 'pt_';
$config['timezone'] = 'Europe/Berlin';
$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
?>
My .htaccess:

Code: Select all

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,NE]
 
# 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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA,NE]
I have entered the following “test1” as the url for the first page.
In the url bar I get http://www.entwurf.wats-on.de/pt/test1.html
The browser shows 404 not found.
If I comment out the inserted line in the config and remove the .htaccess all works fine with the standard url http://www.entwurf.wats-on.de/pt/index.php?page=test1 .
I can not see what I am doing wrong. As usual I expect it is obvious.
Would be greatfull for help.
No one else seems to have this problem??? or I least I have not found any mention of it.
Tried clearing all casches Still no joy
Thanks
Dave

Re: 404 error when pretty urls are used

Posted: Mon Oct 15, 2012 8:01 am
by Rolf
Add to .htaccess

Code: Select all

#Sub-dir e.g: /cmsms
RewriteBase /pt

Re: 404 error when pretty urls are used (Solved)

Posted: Mon Oct 15, 2012 8:20 am
by Dave59
Thanks Rolf.
It works!
I forgot I had installed it in a test sub domain.
Very quick and a great help.
Dave