Page 1 of 2
Clean urls for idiots
Posted: Fri Mar 10, 2006 9:45 am
by lennon
Hi. I'm running CMS Made Simple 0.11.2.
I'm using PHP 4.4.1, and MySQL 4.1.12 running on Windows 2003.
Now I've read through the forum and aint been lazy but am having problems installing the clean urls.
Its this bit that confuses me:
Copy /doc/htaccess.txt to /.htaccess
Does this mean move htaccess.txt to a folder called .htaccess
So the structure would be .htaccess/htccess.txt ? Is the "." neccessery?
Do I leave the the old htaccess.txt where it is in the doc folder?
Sorry if this is basic stuff but I could do with some help on this please
Re: Clean urls for idiots
Posted: Fri Mar 10, 2006 9:55 am
by sioux
Download htaccess.txt to your pc.
Then upload it to your root directory (the one where you installed all the cmsms files)
Right click on it and select 'rename.'
Rename it to .htaccess
That's it!
Obviously if your ftp program will allow you to move your files online then do so. Mine's a bit ancient and won't!
Re: Clean urls for idiots
Posted: Fri Mar 10, 2006 10:01 am
by pishkus
You also have to change $config['assume_mod_rewrite'] to true, to make cmsms output clean urls.
Re: Clean urls for idiots
Posted: Fri Mar 10, 2006 10:03 am
by lennon
Cheers guys will give it a bash. Thanks for the swift replys.

Re: Clean urls for idiots
Posted: Wed Mar 15, 2006 5:00 pm
by lennon
I've tied this a good few times and tried the various incarnations. no joy! It stays the same.
I've asked my hosting company if they run apache and they do. Is there anything on their end that could be the cause?
Can anyone advise me if there's anything else I can try? or will I call it a day?
Any advice appreciated.
Re: Clean urls for idiots
Posted: Wed Mar 15, 2006 6:25 pm
by Tom
You shall also have the same extension that is in .htaccess, in your config.php
eg. .htaccess:
RewriteRule ^(.+)\.shtml$ index.php?page=$1 [QSA]
config.php:
$config['page_extension'] = '.shtml';
Ie. here both are .shtml, so it shall work. I'm not sure whether that can be a reason of your problems, but it was a reason of my self-imposed problems just few minutes ago.....
Ask your webhosting company if they have mod_rewrite module installed, Apache alone is insufficient. Though most good hostings have it by default.
Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 9:12 am
by lennon
Cheers tom. I think I had the extensions the same. I'll check with the hosting.
Thanks
Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 9:17 am
by pishkus
my .htaccess i use on my sites is:
Code: Select all
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.+)\.shtml$ index.php?page=$1
</IfModule>
don't know why i'm not using the default CMSMS .htaccess in docs folder, but as far as i remember i changed it cause it was not working...
maybe mine will solve some problems?

Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 9:48 am
by lennon
Right I've got them working after a month of trying!!!
Thanks everyone who has lent a hand.
Pishkus script seemed to do the job. However

they only work when I type them in ie contact.shtml.
I assumed my menu and links would change automatically and be clean? Am I missing something yet again?
Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 9:55 am
by pishkus
If these menu are standart menus, then they will change automatically.
The thing is, when you set $config['assume_mod_rewrite'] = true; it tells the core classes the links should be 'page_alias'+'page_extension'.
However, it will not alter the links you've inserted directly into content using FCK editor or whatever, because these links are saved into database, and not made automaticaly.
Cheers!
Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 9:59 am
by pishkus
BTW your old links that eg are index.php?page=contacts will still work, but now when you turned on the mod rewrite rule, the contacts.shtml will work as well.
Simply the contacts.shtml link is converted to index.php?page=contacts using Apache.
Hope i made at least a little bit more clear

Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 10:12 am
by lennon
I understand what you mean. I just thought that when I clicked on a menu link it would be the clean url not the messy one. I realise that both links work.
Here's the site
http://www.galwaysolicitor.ie/index.php
As you can see if you type blah.shtml you get the page but not if you use the menu.
Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 10:17 am
by pishkus
My questions:
Did you make the menus through a default plugin, or your own written plugin or is the menu simple links in template? If its a standart plugin, did you turn on $config['assume_mod_rewrite'] = true; ?
If you simply insert link in template like Who we are it will not be automaticaly changed by mod rewrite.
Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 10:25 am
by lennon
I used the default one of default menus in the latest realease.
Yep I did change the config file.
wait I've cracked it. The issue was with my ftp. When I changed the config to 444 and was uploading the new config it was saying it had uploaded successfully. It hadn't. I deleted the old config and then uploaded the new and 444'd this one.
thanks pishkus - I really appreciate all your help. I'll have a pint of guinness in your honor (and everyone elses here) on paddys day.
Cheers
Re: Clean urls for idiots
Posted: Thu Mar 16, 2006 2:53 pm
by triggerhippie
also anyone reading this later - you may want to comment out the referece to the base url:
use # to comment out
Code: Select all
# CMSMS REWRITE RULE
php_flag magic_quotes_gpc Off
php_flag register_globals Off
php_flag session.use_trans_sid Off
Options +FollowSymLinks
RewriteEngine On
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
# END CMSMS REWRITE RULE
additionaly i found that I had to put this into where i had cmsms installed (i.e in a folder names "cms" in the root of my webspace), not as i always understood in the root.