Clean urls for idiots

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.
lennon
Forum Members
Forum Members
Posts: 88
Joined: Fri Jan 13, 2006 12:19 pm

Clean urls for idiots

Post 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
sioux

Re: Clean urls for idiots

Post 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!
pishkus

Re: Clean urls for idiots

Post by pishkus »

You also have to change $config['assume_mod_rewrite'] to true, to make cmsms output clean urls.
lennon
Forum Members
Forum Members
Posts: 88
Joined: Fri Jan 13, 2006 12:19 pm

Re: Clean urls for idiots

Post by lennon »

Cheers guys will give it a bash. Thanks for the swift replys.

:)
lennon
Forum Members
Forum Members
Posts: 88
Joined: Fri Jan 13, 2006 12:19 pm

Re: Clean urls for idiots

Post 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.
Tom

Re: Clean urls for idiots

Post 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.
lennon
Forum Members
Forum Members
Posts: 88
Joined: Fri Jan 13, 2006 12:19 pm

Re: Clean urls for idiots

Post by lennon »

Cheers tom. I think I had the extensions the same. I'll check with the hosting.

Thanks
pishkus

Re: Clean urls for idiots

Post 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? :)
lennon
Forum Members
Forum Members
Posts: 88
Joined: Fri Jan 13, 2006 12:19 pm

Re: Clean urls for idiots

Post 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?
pishkus

Re: Clean urls for idiots

Post 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!
pishkus

Re: Clean urls for idiots

Post 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 :)
lennon
Forum Members
Forum Members
Posts: 88
Joined: Fri Jan 13, 2006 12:19 pm

Re: Clean urls for idiots

Post 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.
pishkus

Re: Clean urls for idiots

Post 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.
lennon
Forum Members
Forum Members
Posts: 88
Joined: Fri Jan 13, 2006 12:19 pm

Re: Clean urls for idiots

Post 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
triggerhippie

Re: Clean urls for idiots

Post 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.
Post Reply

Return to “CMSMS Core”