Sunday, 09 November 2003
From Mambo Open Source 4.5 Beta 1.0.3 we decided to start implementing Search
Engine Friendly URL's (SEF). We did some initial work and now will need your help
with testing and finding bugs.
SEF in Mambo Open Source is for Apache only and all logic is in PHP. There are only
3 lines in .htaccess for mod_rewrite to point server to the right file.
To turn SEF support ON:
Before you had link or form pointing to: index.php?option=com_contact&Itemid=$Itemid
Now you just do this: echo sefRelToAbs("index.php?option=com_contact&Itemid=$Itemid");
This will transform this relative URL to link like: http://www.domain.com/component/option,com_contact/Itemid,3/
Now mod_rewrite will point Apache to index.php and sef.php will do the back-transforming
magic.
Note that SEF is turned OFF by default and no changes in any way are needed if you
are running Mambo Open Source the old way, without SEF.
Please make sure that you have right settings before posting in the forums that
it doesn't work. We will be deleting all comments from people that haven't checked
above 5 steps. So:
Search Engine Friendly URLs [SEF] in Mambo 4.5
November 9th, 2003, 21:54
Saka
In Mambo 4.5 we decided to implement Search Engine Friendly URLs.
SEF in Mambo is for Apache only. It is using mod_rewrite for pointing server to
the right file whilst all logic is in PHP. There are only 3 lines in .htaccess for
mod_rewrite directions.
To turn SEF support ON:
1) You must run Apache
2) You must have mod_rewrite enabled
3) Your server must allow .htaccess override
4) Set $mosConfig_sef= "1" in configuration.php
5) Rename htaccess.txt to .htaccess
You will notice that sections/content/items have nice URLs like:
http://www.site.com/content/view/5/2/
and components have URLs like:
http://www.site.com/component/option...tact/Itemid,3/
Troubleshooting
If you expirience problems with SEF please make sure you tripple checked these troubleshooting
steps:
1) You must run Apache
To check this go to Mambo administration > System > System Info. Server type should
be listed next to Web Server. SEF will not run on IIS, so don't bother trying.
2) You must have mod_rewrite enabled
To check this go to Mambo administration > System > System Info. Click on PHP Information
tab. Scroll down until you find Loaded Modules row. mod_rewrite should be listed
here. If it's not ask your web host to activate mod_rewrite.
3) Your server must allow .htaccess override
To check this delete everything from your .htaccess file and write a simple command
here, for example:
Code:
Redirect /google.html http://www.google.com
Now point your browser to http://www.yoursite.com/google.html If it redirects
you to google.com then you are OK.
4) Set $mosConfig_sef= "1" in configuration.php
You can also activate SEF under Site > Global Configuration.
5) Rename htaccess.txt to .htaccess
This can be done with a FTP program. Note the dot in the beginning! Also note that
you can't do this on windows, you must rename it directly on server.
Information for component developers: What you have to do in order to SEF enable
your CMTs (Components/Modules/Templates):
You must convert all links in CMTs to SEF links. This is done with a function called
sefRelToAbs().
Example:
Before you had link or form pointing to:
index.php?option=com_contact&Itemid=$Itemid
Now you just do this:
echo sefRelToAbs("index.php?option=com_contact&Itemid=$ Itemid");
This will transform this relative URL to link like:
http://www.domain.com/component/opti...tact/Itemid,3/
Now mod_rewrite will point Apache to index.php and sef.php will do the back-transforming
magic.
This function will just return the same link if SEF are disabled so it's safe to
code your CMTs with it from now on.
Note that SEF is turned OFF by default and no changes in any way are needed if you
are running Mambo the old way, without SEF.
Please make sure that you have right settings before posting that it doesn't work.
I will be deleting all comments from people that haven't checked above 5 steps.
So: check your php-info and make sure you run Apache and mod_rewrite module is loaded.
Make sure you renamed htaccess.txt to .htaccess and that you turned SEF on in configuration.php.
If you want to further enhance your site having SEF URLs like:
http://www.site.com/section/category/item/ take a look on SEF advance here:
http://forum.mamboserver.com/showthread.php?t=246
__________________
Emir Sakic
http://www.sakic.net
Last edited by Saka : May 3rd, 2005 at 21:42.
Mambo Open Source 4.5 (1.0.7) released
Tuesday, 06 April 2004
This release fixes a MAJOR security exploit plus a few minor exploits. All sites running Mambo Open Source 4.5 prior to this release need to update immediately.Code: |
if (!$row->bind( $_POST, "gid usertype" )) { |
Code: |
if (!$row->bind( $_POST, "approved published" )) { |
MOS 4.5 (1.0.3) now available
Friday, 27 February 2004
The latest version of Mambo Open Source 4.5 is now available.
For full details on this release please read this. You can download the release from here.
4.5 (1.0.2) now available
Sunday, 01 February 2004
We have released Mambo Open Source 4.5 (1.0.2) the full download is available from http://sf.net/projects/mambo