REWRITE URL'S

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
scottietom
Forum Members
Forum Members
Posts: 18
Joined: Wed Jun 23, 2010 8:37 am

REWRITE URL'S

Post by scottietom »

Hi There, I have read the Rewrite URLs document on www.icms.info specific for cms made simple. I have changed the config.php file to mod_rewrite under url_rewriting and have specified the correct directory in my .htaccess file. The URL's now change to what they are supposed to However the page isnt displaying e.g. 404 Page cannot be found. I have edited the .htaccess file as follows: RewriteBase /clients/ids/cms/

This should link to http://karibaserver.zapto.org/clients/ids/cms

However doesnt display the pages? Ive had a look round and cant find anything and would be greatful for a few pointers from anyone!
Salketer

Re: REWRITE URL'S

Post by Salketer »

I'm not sure what would be the best way to troubleshoot this since I never had any problem except that I was using a different page variable than the default installation.

In your config.php there is a place where you set the name of the page variable, make sure it is the same in your htaccess (defaults to "page" but you might have changed it during install)

I assume you have made sure that your host has the mod_rewrite capacities. If not, test it by using a new .htaccess

Code: Select all

RewriteEngine on
RewriteBase /clients/ids/cms/
RewriteRule ^test$ testfile.php [QSA]
This simple code will redirect http://karibaserver.zapto.org/clients/ids/cms/test to http://karibaserver.zapto.org/clients/i ... stfile.php . Create testfile.php on the CMSMS root and write "hello world" or whatever you prefer, if you can access it with the first URL that means everything is fine server-side.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: REWRITE URL'S

Post by Dr.CSS »

FYI the RewriteBase is for when the install is in a subfolder of the root only, so if you want that in your URL you need to put the site in that folder structure, like so ROOT/clients/ids/cms and in the htaccess you would leave out the last /...
scottietom
Forum Members
Forum Members
Posts: 18
Joined: Wed Jun 23, 2010 8:37 am

Re: REWRITE URL'S

Post by scottietom »

Thanks for repying guys, but im afraid no luck. The php file was retrieved after modifying the .htaccess file. Below are my path settings stored in the config.php:-

$config['root_url'] = 'http://karibaserver.zapto.org/clients/ids/cms';
$config['ssl_url'] = 'https://karibaserver.zapto.org/clients/ids/cms';
$config['root_path'] = '/var/www/clients/ids/cms';
$config['admin_dir'] = 'admin';
$config['previews_path'] = '/var/www/clients/ids/cms/tmp/cache';
$config['uploads_path'] = '/var/www/clients/ids/cms/uploads';
$config['uploads_url'] = $config['root_url'] . '/uploads';

Below are the URL settings in the config.php:-

$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';

my.htaccess file is as follows:-

# Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"

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

# (this is important, so uncomment if your host permit)
#Options -Indexes
#ServerSignature Off
#
Options +FollowSymLinks
#

RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /clients/ids/cms

#
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteCond %{REQUEST_METHOD} !POST$
#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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]


The URL of the site again is http://karibaserver.zapto.org/clients/ids/cms

As you can see the homepage loads but none of the additional pages once clicked.
Post Reply

Return to “CMSMS Core”