***********************************************************

     SEF ADVANCE

     v4.2.2 (29.08.2005)

     Search Engine Friendly Addon for 

     Mambo 4.5.x / Joomla 1.0

     Dynamic portal server and Content management engine



     Copyright (C) Emir Sakic, 2003-2005.

***********************************************************



What is SEF advance?

--------------------

SEF advance is a Mambo 4.5 / Joomla 1.0 addon which will extend 

built-in search engine friendly URL functionality and raise it on a higher level.

Instead of ordinary SEF URLs like:

http://www.site.com/content/view/1/2/ which don't tell much about your content

you will get URLs in form:

http://www.site.com/Section_Name/Category_Name/Item_Name/



Why SEF advance?

----------------

Because your URLs will consist of content titles rather than numbers,

SEF advance will drastically increase your search engine positions.

SEF advance is especially suitable for sites with much content

and sites depending of traffic coming from search engines.

Many search engines tend to give priority to links which contain searched string.

This is exactly what SEF advance transforms Mambo / Joomla to.



Examples

--------

This is how Mambo / Joomla URLs look like using SEF advance:

http://www.site.com/The_News/

http://www.site.com/The_News/Latest_News/

http://www.site.com/The_News/Latest_News/Welcome_to_Mambo_Open_Source/

http://www.site.com/The_News/Latest_News/Example_News_Item_4/2/

http://www.site.com/Typed_Content/

http://www.site.com/blogsection/The_News/

http://www.site.com/weblinks/

http://www.site.com/contact/

http://www.site.com/poll/14/

http://www.site.com/whatever/



What are requirements for SEF advance?

--------------------------------------

SEF advance works on the same principles as basic Mambo / Joomla SEF.

It requires Apache, mod_rewrite and Zlib library.

Make sure you can run built-in SEF (available from Mambo 4.5 beta 1.0.3)

and that you can install Mambo / Joomla components automatically (Zlib support)

before purchase of SEF advance.



How do I install it?

--------------------

If you are using Mambo 4.5.1 or higher or Joomla 1.0 follow these steps:

  1) Make sure you have built-in SEF enabled and functional

  2) Install SEF advance by uploading the SEF advance zip file in admin (Components > Install)

If you are using Mambo 4.5.0 you will have to install it by replacing two core files.

  1) Make sure you have built-in SEF enabled and functional

  2) Replace your .htaccess with the new one

  3) Go to includes/ directory of your Mambo installation

  4) Replace file sef.php with the new one



Can I configure it?

-------------------

SEF advance offers many URL customization possibilities.

If you are using Mambo 4.5.1 or higher or Joomla 1.0 you will be able to do the setup under the admin area 

(Components > SEF advance> Configuration).

If you are using Mambo 4.5.0 you will have to open sef.php with a text editor and edit the settings.



The following text explains what the various settings are for.



Strings:



You can configure blog and archive strings (for example use "a" and "b"):

define("_SEF_BLOGSECTION", "blogsection");

define("_SEF_BLOGCATEGORY", "blogcategory");



As well as all core components strings:

define("_SEF_FRONTPAGE", "frontpage");

define("_SEF_WEBLINKS", "weblinks");

define("_SEF_POLL", "poll");

define("_SEF_BANNERS", "banners");

define("_SEF_CONTACT", "contact");

define("_SEF_LOGIN", "login");

define("_SEF_SEARCH", "search");

define("_SEF_NEWSFEEDS", "newsfeeds");

define("_SEF_WRAPPER", "wrapper");



If you have a component with SEF advance extension you can customize its default string

by editing $custom_comp array. For example to replace word "userlist" in the URL with "u" you would have:

$custom_comp = array(

	"userlist" => "u"

);



Preferences:



You can define the character that divides the words in URLs:

define(_SEF_SPACE, "_");

Instead of default underscore you can define a hyphen (-) or something else.



SEF advance allows you to define a sufix for the end of your URL:

$sufix = "";

Instead of default trailing slash you can define a .html or something else.



You can also choose whether to use shorter URLs (News/Latest/)

or longer (The_News/Latest_News).

Do it by editing this variable in sef.php:

$longurl = 1;

If you choose shorter URLs SEF advance will use section/content titles instead of names.

It will also use title alias for articles so don't forget to enter aliases for each item.



It is possible to choose to have all links in lowercase by setting:

$lowercase = 1;



You can select the preference for the Home link in main menu.

Some users may prefer Home link to lead to "frontpage/" instead to the root.

In that case set:

$homeroot = 0;

This may be useful for web sites that have welcome index.html page placed on the web root.



To make your URLs more unique you may setup the option:

$uniqitem = 1;

Every item will get creation date and id appended so it becomes unique and Google News friendly.



Replace:



URL replace feature can be useful to international users having special characters in their languages,

You can specify the characters that you want replaced rather than URL encoded in the URL string.

For example instead of having special character "" encoded with "%E6" you may choose to replace it 

with "ae" which gives little friendlier URL:

$url_replace = array(

	"" => "aa"

);

You can have as many replacement combinations as you want, just separate them with commas in the array.



To reduce the error rate SEF advance's URL is url encoded.

This replaces all special characters with a percent (%) sign followed by two hex digits.

Some users may think that it doesn't look very nice in URL and that's why you can make exceptions from this rule.

Just define the chars you don't want encoded in this array:

$url_exception = array("?","!");

Enclose every char in double quotes and separate them with commas in the array.

Note that not all characters can be excepted and you will have to test if the settings you enter cause problems for you.



Custom 404 page allows you to setup a page that user will be redirected to if no content has been found.

This is similar to ordinary server 404 error redirect that user is sent to if non-existing site has been requested.

By default it is setup to site root but you can design your own 404 page and setup the link to it here: 

$custom404 = "";

If you point to a physical 404 file the Not Found header will be returned if the page is not found instead of Redirect header.



Alias

-----

If you are not happy with the look of a particular URL you can manually enter an alias for that link.

This alias will then be used instead of automatically generated SEF URL:

$url_alias = array(

	"index.php?option=com_content&task=view&id=4&Itemid=9" => "Newsflash 3"

);

You can have as many aliases as you want, just separate them with commas in the array.

Be sure that Non-SEF URL is relative with no leading slash (begins with index.php?option=...).

To find out particular relative URL temporarily disable SEF in Global Configuration.



Old links

---------

All links within Mambo / Joomla will be automatically changed to the SEF advance URLs as you install the component.

Even all relative internal links within Mambo / Joomla content will be automatically translated (4.5.1 or higher).

However you might have many static old-style SEF links in your documents and spread all around internet which are not so easy to change.

SEF advance will take care of them and automatically redirect all requests for old links to their correspondent advanced URLs.

The correct Permanent Redirect header will be returned so search engines will know that they need to replace old links.



3rd party component extensions

------------------------------

SEF advance has a built-in API for 3rd party component extensions.

This enables any 3rd party component for Mambo / Joomla to get SEF advance style URLs.

The extension file must be called sef_ext.php and exist in the main component directory.

It contains a class (sef_componentname()) with functions to create the SEF advance URL (create())

and revert to Mambo / Joomla query URL (revert()).

If SEF advance founds the extension it includes the file and processes the class.

For more info about the extension refer to included example file (sef_ext.php).
