Wednesday, February 17, 2010

Search Engine Friendly URL

Search Engine Friendly urls


This tutorial will guide you through setting up the SEF - Search Engine Friendly Urls for the latest version of Joomla 1.5

By default Joomla will produce URLs which look like this

Joomla Search engine friendly url

As you can see the default URL includes the PHP sting, component name plus a number of parameters which don't look to good to search engines or your visitors.

Enabling the SEF functionality built into Joomla! offers the following advantages

  • It will make it easier for other web sites to link directly to the SEF article rather than to the default URL generated by Joomla!
  • Visitors are more likely to remember the short easy to read SEF URL
  • Provides the visitor and search engines with useful information about the article title and the section, category the article is associated with.
  • You can include targeted keywords in the URL which reference the section, category and article title which may help improve your search engine position
  • Can resolve the issue where your template is displayed on the front page but not on other pages

The above are just some of the benifits of using SEF Urls.

We will now explain how you can setup your Joomla! site to use this functionality.

What will you need to setup the search engine friendly urls

  • Access to the Joomla Administrator area
  • FTP Access to rename and update the htaccess.txt file included with the default installation of Joomla!
  • Your web site is hosted on a Linix platform, this tutorial does not cover setting up SEF urls for IIS

Step 1 : Rename Htaccess.txt file

The first step is to rename the htaccess.txt file located in the root of the public_html directory where you have installed Joomla!. To do this log into the web site using your FTP client and rename the htaccess.txt file to .htaccess

Please note you must add the dot . before the htaccess file when renaming it from htaccess.txt to .htaccess

Step 2 : Configuration.php file permissions

In order to change the SEO settings you will need to ensure the Joomla! configuration.php file is writable.

To make the configuration.php file writable complete the following

  1. Log into the web site using your FTP client and browse to the Joomla installation
  2. Select the configuration.php file and change the file permissions from CHMOD 644 to CHMOD 777
After you have updated the SEO settings ALWAYS change the file permissions for the configuration.php file back to CHMOD 644

STEP 3 : Setup Joomla SEO settings

  1. Log into the Joomla! administrator area
  2. Select the Global Configuration icon
  3. You will now see the following SEO setting
  4. To save the SEO settings select the APPLY button

4. Each setting you select from the above will produce a different result.

5. If you enable the " Search Engine Friendly URLs" option

6. The URL will look like this and include the .index.php name in the URL

7. Using the above method may break the template layout "your design displays ok on the front page but not on other pages"

8 . If you enable both the "search engine friendly URLs" plus "Use Apache mod_rewrite"

9. The URL will look like this and produce a clean easy to read URL.

10. If you enable all 3 of the above settings

11. The URL will display a .html suffix

If you want search engine and human freindly URLs we recommend you choose both the "search engine friendly URLs" plus "Use Apache mod_rewrite" seo options.

From http://www.joomladesigns.co.uk/Tutorials/Joomla/Search-Engine-Friendly-urls.html

Store Procedure and Function

The main different between store procedure and function is that
- Function can return only one value and must return a value
- Store procedure can have many IN or OUT parameters and no return value
- Function can be called in a select statement but store procedure can not be called in a select, it must be executed by 'call storeprocedure name'
Example
create function AddA(p_inparam varchar(30)) returns varchar(30)
return concat('A',p_inparam);

mysql> select AddA(emp_name) from emps;
+----------------+
| AddA(emp_name) |
+----------------+
| ARoger |
| AJohn |
| AAlan |
+----------------+
3 rows in set (0.26 sec)

create procedure AddB(INOUT p_inparam varchar(30))
set p_inparam := concat('B',p_inparam);

mysql> select AddB(emp_name) from emps;
ERROR 1305 (42000): FUNCTION pers.AddB does not exist

mysql> select call AddB(emp_name) from emps;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call AddB(emp_name) from emps' at line 1