Page 1 of 1

By-passing existing site with new cms site

Posted: Thu Aug 30, 2007 7:58 am
by pixel8
This is a 2 part question:

Part 1. I have an existing 'static' site over at www.stg.uk.com/, and have developed a CMS Made Simple version in a folder/directory below this called 'cms' (www.stg.uk.com/cms/). Everything seems to be working fine, so I have had a look at the instruction document for making 'Pretty URLs', and changed the config.php URL Settings and created a .htaccess by copying this from the /docs/ folder and uploading it to the root directory.

config.php

Code: Select all

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = true;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = false;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
.htaccess

Code: Select all

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On

#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
When I now view the 'cms' site the Home page (page alias 'index') appears, but when you view the other pages you get a 404 error. I have also cleared the cache as advised and reloaded.
Am I missing something in either the config.php or .htaccess file?

Part 2. Would the above problem be caused by the fact that there is already a 'live' site at www.stg.uk.com, and would I need to delete this before it would work properly?

Re: By-passing existing site with new cms site

Posted: Thu Aug 30, 2007 11:08 am
by Pierre M.
Hello,

first, you are near the solution for part 1 and don't worry about part 2.

Please confirm/check that your hosting provider supports mod_rewrite via .htaccess files.
Then, try to alter slightly your config.php :

Code: Select all

$config['internal_pretty_urls'] = false;
because it is either internal hack or mod_rewrite.

If it doesn't work, please tell us where is your .htaccess is (which folder). May be you will need to add a rewrite base and/or move it. But first, try to disable the internal hack.

Pierre M.

Re: By-passing existing site with new cms site

Posted: Thu Aug 30, 2007 1:45 pm
by pixel8
Hi there Pierre,

I've just got word back from my provider, so I will make some of the changes you've suggested tonight when I get home from work, and let you know how I get on.
Cheers  ;D