Hello Guyz,
I have Coded an Infusion which will provide you the ability to make your website URLs SEO Friendly. I hope that you will like it.
I tested it thoroughly but I think that people would test it more better.
Infusion Algorithm:This infusion is based on REGEX/Regular Expression search.
1. Search for :
http://mysite.com/news.php?readmore={some number}2. Replace it with :
http://mysite.com/News-{some number}-News-Description3. Similarly do this for other URLs of Core.
Working:As you know, it is quite impossible to implement it for all kind of URLs in the system, on basis of using Regex, you may find some little areas to be normal as they are in the system.
But I've tried my best to make each and every possible URL to be user friendly.
Testing and Reporting:Currently, its Live Demo and Testing is done at :
http://fusion8.co.cc/Please Test it by Downloading and Installing it from below and kindly Report any "Errors" from the Error Log.
Installation:1. Download and install
seo_friendly_urls_panel and Infuse it.
2. Add the Panel
seo_friendly_urls_panel to Panels and Display it on all pages if you are adding it as Upper/Lower Panel.
3. A Small Change in maincore.php :
Find :
define("TRUE_PHP_SELF", $current_page);
Replace with :
Use this Code if you have Choose SEO URLs Type as Plain : http://yoursite.com/newsif (preg_match("/\/(administration)\//", $current_page))
{
define("TRUE_PHP_SELF", $current_page);
}
else if (preg_match("/".preg_replace("/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $settings['opening_page'])."/", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $current_page)))
{
define("TRUE_PHP_SELF", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "/$1", $current_page));
}
else
{
define("TRUE_PHP_SELF", $current_page);
}
Use this Code if you have Choose SEO URLs Type as HTML : http://yoursite.com/news.htmlif (preg_match("/\/(administration)\//", $current_page))
{
define("TRUE_PHP_SELF", $current_page);
}
else if (preg_match("/".preg_replace("/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $settings['opening_page'])."/", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $current_page)))
{
define("TRUE_PHP_SELF", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "/$1.html", $current_page));
}
else
{
define("TRUE_PHP_SELF", $current_page);
}
Done !!!
EDIT : Sorry I forgot to include the code from HTACCESSAlso, You must paste the code in your
.htaccess file.
.htaccess File attached now !