***********************************************************
SEF Advance
v6.0 (11.03.2009)
Search Engine Friendly Extension for
Joomla! 1.0 / Mambo 4.x
Dynamic portal server and Content management engine
Copyright (C) Emir Sakic, 2003-2009.
Developer: Emir Sakic - http://www.sakic.net
First release: 20.11.2003
***********************************************************
What is SEF Advance?
--------------------
SEF Advance is a Joomla! 1.x / Mambo 4.x 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 Joomla! / Mambo to.
Examples
--------
This is how your Joomla! / Mambo URLs will look like after you installed 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-joomla/
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/rate-my-site/
http://www.site.com/whatever/
What are requirements for SEF Advance?
--------------------------------------
SEF Advance is encoded with ionCube encoder. To run it you need to download and install
free ionCube loader (available at http://www.ioncube.com/loaders.php).
In most cases it's enough to extract the loaders directory on your site's root (/ioncube/).
There is a free tester script available for download at:
http://www.sakic.net/products/sef_advance/requirements/
which will determine whether you need to upload loaders to your site or your server already
supports ionCube encoded files.
SEF Advance works on the same principles as basic Joomla! / Mambo SEF.
It requires Apache and mod_rewrite.
Make sure you can run built-in SEF (available from Mambo 4.5 beta 1.0.3)
before purchase of SEF Advance.
How do I install it?
--------------------
If you are using Joomla 1.0 or Mambo 4.5.1 or higher follow these steps:
1) Make sure you have built-in SEF enabled and functional
2) Replace your .htaccess with the one found in SEF Advance zip package
3) Install SEF Advance by uploading the SEF Advance zip file in admin (Installers > Components)
If you are using Mambo 4.5.0 you will also have to replace two core files.
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)
3) Replace your .htaccess with the one found in SEF Advance zip package
4) Go to includes/ directory of your Mambo installation
5) Replace file sef.php with the one found in SEF Advance zip package
Can I configure it?
-------------------
SEF Advance offers many URL customization possibilities.
If you are using Joomla! 1.x or Mambo 4.5.1 or higher you will be able to do the setup under the admin area
(Components > SEF Advance > Configuration).
You can also find information about different settings under the help button in the admin area.
If you are using Mambo 4.5.0 you will have to open sef_conf.php with a text editor to edit the settings.
In that case read on for information on what different 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_REGISTRATION", "registration");
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:
SEF Advance can be turned off by setting $sef_enabled = 0;
In that case links will be rewritten to built-in SEF URLs.
You can define the character that divides the words in URLs:
define(_SEF_SPACE, "-");
Instead of default hyphen you can define an underscore (_) or something else.
SEF Advance allows you to define a suffix 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_conf.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;
The article URLs are customizable and you can choose whether to display section and category name.
By setting $inc_sec = 0; you will get article URLs in form category/article and by setting $inc_cat = 0;
you get URLs like section/article. You can also get only article/ URL if you set both values to zero.
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.
If you are using Joom!Fish / Mambelfish, the multilanguage component, you can add additional support by having:
$sef_fish = 1;
This will allow you to access multilingual content via URL. For example if you have content in
English and German you will have unique URL for each content version, e.g.:
http://www.site.com/en/section/category/item/
http://www.site.com/de/section/category/item/
A disadvantage is that then you can't have two-character section names or items.
You can select whether you want to use the language prefix for default language.
If you want to skip the prefix for default language you can set:
$sef_nupd = 1;
In this case the above example URLs will be:
http://www.site.com/section/category/item/ - for default, English language
http://www.site.com/de/section/category/item/ - for German language
This will help preserve your original URLs if you installed Joom!Fish / Mambelfish after the site was in use.
To avoid duplicate content, you can setup SEF Advance to redirect requests for old-style, built-in, core SEF URLs
and non-SEF URLs to corresponding SEF Advance URLs. This is done by setting variables:
$sef_bird = 1;
$sef_nsrd = 0;
WWW redirect feature will help the search engines decide canonical URL for your site.
If your site is accessible both as www and non-www this will make a 301 redirect to the version that you have
defined in configuration file. This way your site will not be double ranked by search engines.
$www_redirect = 1;
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.
IMPORTANT: This setting should be used very carefully, remember that replacement works both ways.
You can't replace a character with a string that occurs in regular content titles.
An example of wrong usage would be "å"=>"a", as this would break all URLs that contain "a".
Instead use a string that doesn't occur in regular titles, like "å"=>"aaa".
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.
Some 3rd party components could be poorly coded and misbehave when SEF is activated.
In that case you can specify the components to be excluded from URL rewrite so you can still use them as with SEF turned off.
$com_exception = array(
"com_something"
);
Caching can improve the performance for sites with much content by decreasing the database load.
If turned on, the system will use a cached copy of an URL instead of querying the database and calculating it on each request.
You should use cache only when you have finished building your site.
If you make any changes in URL configurations, site structure, site menu, change names of existing articles,
categories or sections, you must empty the cache! To turn on the cache set:
$sef_cache = 1;
Time of cached URL validity (in seconds), if the cache is turned on is changed here:
$sef_cachetime = 86400;
Use a longer value for an established site and shorter for a site that still might be under construction.
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 or to an internal content item the Not Found header will be returned,
if the page is not found, instead of Redirect header.
Debug will help you troubleshooting the site. Setting $sef_debug = 1; will display some useful information
about internal system state at the end of the page.
When Debug IP is set ($sef_debugip = '127.0.0.1';), only the users coming from that IP address
will be able to see the debug output. If empty, all visitors will see debug information.
You can improve search engines optimization by automatically adding some important SEO elements to your website content.
$seo_h1 = 1;
Inserts h1 tags on article titles styled with contentheading. You can style the h1 tags in CSS.
$seo_title = 1;
Titles on Read more... - Appends article title on Read more... hypertext links,
thus helping identify the target of each link.
$seo_alt = 1;
Add Alt-text - Inserts description on article images with missing or empty alt-text.
$seo_nofollow = 1;
Inserts nofollow relation attribute to anchor tags for outgoing links
$seo_blank = 1;
Inserts target=_blank to anchor tags for outgoing links to open them in new window
$seo_icon = 0;
Adds new window icon next to outgoing links
$seo_canonical = 0;
Inserts Canonical tag to the page 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.
Redirects
---------
You can define redirects of certain URLs to another ones.
It can be an old link that changed or even a short version of existing document.
When user requests the source URL he will be redirected to the target of your choice and correct header will be sent to browser.
$url_redirect = array(
"some/url/" => "animals/pets/cat/"
);
You can have as many redirects as you want, just separate them with commas in the array.
Be sure that source URL is relative with no leading slash.
Old links
---------
All links within Joomla! / Mambo will be automatically changed to the SEF Advance URLs as you install the component.
Even all relative internal links within Joomla! / Mambo 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 Joomla! / Mambo 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 Joomla! / Mambo 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).
Problems
--------
For questions and support please refer to the FAQ section of my homepage:
http://www.sakic.net
If you don't find the answer there you may send me an email using the contact form.
Any feedback is highly welcome too.
Visit http://www.sakic.net for more exciting Components and Modules for Joomla! / Mambo CMS.


