Joomla Hosting BLOG

Blog about Joomla, Technologies and Hosting Service

Joomla Hosting - ASPHostPortal.com :: Improve SEO in Joomla Using Microdata

clock January 18, 2017 06:12 by author Armend

Microdata is quickly becoming a must-have tool for site developers that want to improve their overall SEO strategy. By using Microdata tags, sites can tell search engines what type of content is being presented.
Let’s say you want to feature a movie on your site somewhere, and you would like to let the search engine know that you are listing a movie, as well as some important information about it.


Enter Microdata tags. These let search engines like Google, Bing, and Yahoo know that people searching for that particular movie might find your site useful. If anything, it makes it a lot more clear to their crawlers what the content on your site is about, so it can better determine how you fit in the results.
Microdata is more accurate than traditional metadata because it is content specific, not page specific. You can tag individual blocks of text differently, making a clear difference between a person’s name, their address, and a recipe for lobster ravioli.

Microdata has been one of the top features requested for Joomla! from marketers!

Developers will now be able to incorporate microdata more easily into their extensions and sites. From automating the Author tag in articles, to generating detailed markup for directories of information, the microdata library will significantly enhance how you can optimise SEO with Joomla!

Going Big on SEO & Better visibility in Search Engine results with MicroData

Joomla’s new microdata library, being released in Joomla, is going to significantly change how search engines can interpret the information you have on your site. The addition of microdata is one of the most significant SEO improvements since the release of Joomla 3.
When search engines process pages for indexing in their databases, they usually don’t know what the context of the text on the site is. Context is extremely important in delivering the correct information to end users.  For instance when you have ‘Avatar’ on a page, how does the search engine know whether its being referenced as an image avatar or the movie avatar, or just a regular image?

Microdata takes the guesswork out of this for the search Engines. Microdata places markup code inside your content that the search engine can read, and then rather than just indexing words, it can apply a context to them to identify features within the content.
This then lets the search engines identify things like who your article authors are, details about your business as a place, or details about events in your calendar on the site.

The next great benefit of using microdata is the ability to create Rich Snippets. Rich Snippets allows you to configure your content to show up as specially formatted data in search engine results. For example you can configure microdata on reviews and ratings on your site so that they then appear as part of the snippet when the search engine result is displayed.

How to use the JMicrodata library?

To use the new microdata semantics library you need to make an instance of the library in your extensions.

EXAMPLE:


        $microdata = new JMicrodata('Article');

So let's suppose that we have the following string:

        Written by ASPHostPortal Web Hosting

And we need to add an author property:

        echo 'Written by' . $microdata->content(“ASPHostPortal Web Hosting”)->property('author')->fallback('Person', 'name')->display();
   

The library will display:

        Written by
        <span itemprop='author' itemscope itemtype='https://yourdomain.com'>
            <span itemprop='name'>
                ASPHostPortal Web Hosting
            </span>
        </span>

   
What happens if the current scope is something other than 'Article', for example a 'Product' scope, and the current scope doesn't have an author property?
Well it will fall back in:

        <span itemscope itemtype='https://yourdomain.com'>
            <span itemprop='name'>
                ASPHostPortal Web Hosting
            </span>
        </span>       


If we want to disable the microdata semantics output?
You can simply disable the microdata output:

        $microdata->enable(false);


Best Joomla Hosting

ASPHostPortal.com is the leading provider of Windows hosting and affordable Joomla Hosting. Joomla Hosting from ASPHostPortal.com provides a safe, reliable and performance-driven foundation for your Joomla website. Joomla is the perfect Content Management System for managing and developing your website with one of ASPHostPortal’s Hosting plans. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability.



Joomla Hosting - ASPHostPortal.com :: Tips To Disable Element in Joomla

clock January 11, 2017 05:18 by author Armend

In case you are utilizing Joomla CMS dependent web-site and hate overlapping visibility of Joomla components on the website property web page, then you definitely have found the appropriate write-up to receive rid off with this monsters trouble. However, Joomla parts plays a crucial function in improving the practical talents of a web-site, although the overt existence of these equipment can destroy the appears of your enticing website homepage.

Step: 1

Develop a new module and set the location as frontcomp:

You need to place below given codes into the index file of your Joomla template.

<?php if($this->countModules(‘frontcomp’)) : ?>
<jdoc:include type=”modul es” name=”frontcomp” style=”xhtml” />
<?php endif; ?>


Step: 2

Now Replace Below Code With Display Component:

<?php if(!$this->countModules(‘frontcomp’)) : ?>
<jdoc:include type=”message” />
<jdoc:include type=”component” />
<?php endif; ?>

Step:3

Creation of Custom Module

It is the third step of your process. Now, you need to create a new and customized HTML module, set the position of module as Frontcomp and select homepage only to display.
That’s it! You have done it fabulously, Now, you can visit your website and check the expected changes. If you did not find overlapping Joomla components at the home page of your website, then you have certainly did a great job.

Best Joomla Hosting

ASPHostPortal.com is the leading provider of Windows hosting and affordable Joomla Hosting. Joomla Hosting from ASPHostPortal.com provides a safe, reliable and performance-driven foundation for your Joomla website. Joomla is the perfect Content Management System for managing and developing your website with one of ASPHostPortal’s Hosting plans. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability. 



Joomla Hosting - ASPHostPortal.com :: How To Develop a Joomla from scratch

clock January 4, 2017 06:43 by author Armend

Want a customized joomla template for the business requirements? It really is so easy to construct a template of one's decision as an alternative to paying thousands for it. So lets commence now.

 


To produce a joomla template you may require at the least two files.

  1. templateDetails.xml which can be mainly configuration file containing info like autor name, e mail, template version, folders and file names and module names (we'll discuss it leter).
  2. index.php which can be entry point for all pages
    These are standard files required to create a joomla template, but furthermore you will need some a lot more files to produce a beautiful and powerful template like css, images, language, javascript, html and so forth.

Now lets generate our xml file

<?xml version="1.0" encoding="utf-8"?>
 
<extension version="2.5" type="template" client="site">
<name>template_name</name>
<creationdate>29 January 2014</creationdate>
<author>write Your name here</author>
<authoremail>write your email here</authoremail>
<authorurl>your website url here</authorurl>
<copyright>Copyright here. All rights reserved.</copyright>
<license>License here</license>
<version>2.5.0</version>
<description>TPL_NAME_XML_DESCRIPTION</description>
<files>
<filename>index.html</filename>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_preview.png</filename>
<filename>template_thumbnail.png</filename>
<filename>favicon.ico</filename>
<filename>component.php</filename>
<filename>error.php</filename>
</files>
<positions>
<position>debug</position>
<position>top</position>
<position>position-2</position>
<position>position-3</position>
<position>position-4</position>
<position>position-5</position>
<position>position-6</position>
<position>banner</position>
<position>left-navigation</position>
<position>position-login</position>
<position>position-footer</position>
</positions>
</extension>

As you can see further files are right here like index.html (just to avoid direct access of this folder) , template_preview.png and template_thumbnail.png to show in administrator panel. Here several positions are defined which we'll use in our index.php file.

Your xml is prepared, now produce your index.php file.

<?php defined( '_JEXEC' ) or die( 'Restricted access' );?>
<!DOCTYPE html>
<html xml:lang="<!--?php echo $this--->language; ?>" lang="<!--?php echo $this--->language; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/template_name/css/template.css" type="text/css">
</head>
<body>
<jdoc:include type="modules" name="top" />
<jdoc:include type="modules" name="banner" />
<jdoc:include type="modules" name="left-navigation" />
<jdoc:include type="component" />
<jdoc:include type="modules" name="footer" />
<jdoc:include type="modules" name="position-3" />
</body>
</html>

As you see we have included defined( '_JEXEC' ) or die( 'Restricted access' );
just for security reasons to prevent direct access. is here to tell browsers and crawlers that its a html5 web page.


body{padding:0;margin:0;font-family:"arial";font-size:12px;color:#5d6060;background-color:#fff}
a{text-decoration:none;outline:0}
a:focus,a:active{outline:0}
img{border:0;outline:0}
.container{height:auto;width:1044px;margin-right:auto;margin-left:auto}
.container_sub{height:auto;width:1044px;float:left}
#header_main{height:auto;width:1044px;float:left}
#header{height:118px;width:1044px;float:left}
.header_top{height:auto;width:1044px;float:left}
#logo{height:75px;width:231px;float:left;margin-top:4px}

Your template is ready now but to perform with joomla you've got to upload it below templates folder. Following uploading it to templates folder log in for your joomla administrator and open extensions -> Templates manger. Right here you'll not be able to see your template as you expected. This can be since it calls for one more step, to set up the template. Ok, visit Extensions -> Extension Manager then click Learn tab now click on discover icon around the top-right corner from the page. It's going to search all of the extensions accessible inside your joomla installation, here you will be able to see your template name, select it and click on set up icon on the top-right corner of the page. This will likely install your template. Now you happen to be done. Go to Extensions-> Template manager , right here you'll be able to see your installed template.

Joomla Hosting Recommendation

ASPHostPortal.com provides our customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. We offers Joomla hosting starts from $1/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable Joomla Hosting, we should be your best choice



Joomla Hosting - ASPHostPortal.com :: Easy Steps to Manage Joomla Cache

clock December 21, 2016 10:50 by author ben

According to tutorialspoint website, we will study about Joomla Cache Manager. You can install the cache controller plug-in which helps to improve the performance of Joomla. You can also turn off the cache on the particular pages and component.

Joomla Cache Management

Following are the simple steps used to set up the Joomla cache manager:

Step (1) − Click on Cache Management in Joomla Global Configuration. You will get the screen as shown below.

Following are the details of the fields present in the Joomla Cache Management page:

  • Configure − It is used to select the system for which your site should be used for caching. It also caches your PHP opcode.
  • Access Administration Interface − It allows users to access the administration interface.

Toolbar

Following are the toolbar options in Cache Management.

  • Save − Saves your Cache Manager Setting.
  • Save & Close − Saves the Cache Manager Setting and closes the current screen.
  • Cancel − Cancels the Cache Manager Setting in Joomla.

Best Recommended Joomla Hosting

ASPHostPortal.com is the leading provider of Windows hosting and affordable Joomla Hosting. Joomla Hosting from ASPHostPortal.com provides a safe, reliable and performance-driven foundation for your Joomla website. Joomla is the perfect Content Management System for managing and developing your website with one of ASPHostPortal’s Hosting plans. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability. 



Joomla Hosting - ASPHostPortal.com :: How To Optimization Joomla Site

clock December 21, 2016 04:43 by author Armend

So, you've installed and setup your brand new Joomla web site already. Have you offered some thought to how you could optimize it to load faster but? We'll provide you a few pointers within this write-up.

First of all, an important step one is to enable Joomla's built in caching. You can do this simply using the following steps:

  • Login to your Joomla Administrator Panel
  • Goto > Site > Global Configuration > System (depending on your version this may be slightly different)
  • Set Caching to ON. I'd suggest you leave it set to File and 15mins. Conservative caching in Joomla 3.4 is probably the best option to start with
  • Save your Configuration

Some notes:

  • Once caching is enabled, while new content will prompt a refresh of the system cache, you can trigger this yourself to ensure that 3rd party components that use the inbuilt cache are also refreshed (see the next point)
  • You can manually refresh the cache in Site > Maintenance > Clear Cache (you'll need to, in most cases, select all items, and then press 'delete' up the top right

Next? Properly, the globe is actually your oyster. Depending on your template, there might be quite a few optimization alternatives currently implemented. Most of the 'well known' Joomla template clubs produce outstanding templates that may already be optimized.

Some other critical reading suggestions are:

  • Google's: Minimize payload size and
  • A little more advanced: Optimize browser rendering
  • You may also like to run your site through GTmetrix or this testing tool

Do not overlook as well, the kind of hosting you decide on may also possess a massive impact around the speed of one's Joomla Website. We've not touched on this situation at all in this artilce since it must be obvious.

For additional help in this Joomla Optimization region, make sure to head over for the Joomla Forum, in particular the forum section on Joomla Overall performance (choose the section for the Joomla version you're operating with).

Best Recommended Joomla Hosting

ASPHostPortal.com
ASPHostPortal.com is the leading provider of Windows hosting and affordable Joomla Hosting. Joomla Hosting from ASPHostPortal.com provides a safe, reliable and performance-driven foundation for your Joomla website. Joomla is the perfect Content Management System for managing and developing your website with one of ASPHostPortal’s Hosting plans. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability. 



Joomla Hosting - ASPHostPortal.com :: How to Create an authentication bridge between Joomla and .Net

clock December 14, 2016 04:41 by author Armend

How  to integrate a Joomla site with some ASP.Net pages. User had to login to Joomla, but some pages in the site were built with .Net. The .Net pages had their own SQL Server database, where Joomla used a MySQL database.

The interesting part was how the .Net pages could verify if a Joomla user was logged in. In this post I will share how I did it. Important is that this is a way it will work, but it is not the safest way. It is hackable, because I used a cookie that stored the (encrypted) Joomla user id. So, if you know which cookie you need and are able to decrypt and/or encrypt with the same keys, you’ll be able to fake a logged in user. Note that this was an acceptable risk. The effect of a break in would be small.
As mentioned I used a cookie to store the Joomla user id. It had to be encrypted to provide as much security as possible. With the next Joomla plugin code the cookie is created on the login event. On the logout event the cookie is deleted. This plugin is written for Joomla 1.5, so in newer version you might need to change some bits

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
 
require_once('TripleDES.php'); // See phpseclib: http://phpseclib.sourceforge.net/
 
// Import library dependencies
jimport('joomla.plugin.plugin');
 
class plgUserSystemIntegration extends JPlugin
{
    function plgUserOVSystemIntegration( &$subject, $config )
    {
        parent::__construct( $subject, $config );
    }
    
    function onLoginUser( $credentials, $options )
    {
        $user = &JFactory::getUser();
 
        // Joomla session parameters
        $userId   = $user->get('id');
 
        // Encrypt the userId to store in cookie
        $key = $this->params->get('key'); // these keys are both used in PHP and .Net
        $iv = $this->params->get('iv');
 
        $crypt = new Crypt_TripleDES();
        $crypt->setKey($key);
        $crypt->setIV($iv);
        $value = $crypt->encrypt(strval($userId));
        // Encode string as text
        $value = bin2hex($value);
        
        setcookie("SIJ10", $value); // The cookie name is the identifier. It might be best to make this configurable
        
        return true;
    }  
    
    function onLogoutUser( $credentials, $options )
    {
        // Overwrite cookie
        setcookie("SIJ10", "", time()-3600);
        
        return true;
    }
}

Besides the logout event, some session management needed to be done in case a user didn’t logout. With the next plugin the cookie is deleted if the Joomla session has ended.

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
 
// Import library dependencies
jimport('joomla.plugin.plugin');
 
class plgSystemSystemIntegrationLogout extends JPlugin
{
    function plgSystemOVSystemIntegrationLogout( &$subject, $config )
    {
        parent::__construct( $subject, $config );
    }
 
    function onAfterDispatch()
    {
        $user = &JFactory::getUser();
 
        // If no user is logged in
        if (!$user->get('id'))
        {
            // If cookie value was set
            if(isset($_COOKIE["SIJ10"]))
            {
                // Overwrite cookie
                setcookie("SIJ10", "", time()-3600);
            }
        }
    }
}

Now the .Net part. With the next method(s) the cookie is retrieved and decrypted. The hex2bin is the equivalent of the PHP function, the binary data can’t be put in a cookie. After that the text is decrypted en parsed to an integer. The basic assumption is that as long as that is possible, a user is logged in. What’s more important, in the SQL server database one table included an application level user (used for backend services) that ‘knows’ the Joomla ID. This way the user could be verified against the database, which would make it more secure.

private void Authenticate()
{
    string CookieUserId = "SIJ10";
    if (Request.Cookies[CookieUserId] != null)
    {
        try
        {
            // Decode from hex
            byte[] encodedDataAsBytes = hex2bin(Request.Cookies[CookieUserId].Value); // Change the text to the binary values
 
            // Decrypt
            TripleDES decryptor = TripleDES.Create();
            UTF8Encoding encoding = new UTF8Encoding();
            decryptor.Key = encoding.GetBytes("abcdefgajdhshsgshsjss12"); // It is best to make these keys configurable!
            decryptor.IV = encoding.GetBytes("abcdefgh");
 
            ICryptoTransform decrypt = decryptor.CreateDecryptor();
            byte[] result = decrypt.TransformFinalBlock(encodedDataAsBytes, 0, encodedDataAsBytes.Length); // Decrypt
 
            string returnValue = encoding.GetString(result);
 
            int id = 0;
            if (int.TryParse(returnValue, out id))
                this.UserId = id;
            else
            {
                // Redirect to the login page
                Response.Redirect("~/Login");
            }
 
            // Some session management is needed
            // Check for session timeout
            if (Session["SessionTimeout"] == null)
            {
                // This is the first page request
                Session["SessionTimeout"] = DateTime.Now;
            }
            else
            {
                // This needs to be included in every page (or use a baseclass) or
                // called with every request
                DateTime lastRequest = (DateTime) Session["SessionTimeout"];
 
                if (DateTime.Now.Subtract(lastRequest).Minutes > 20)
                {
                    Response.Redirect("~/Login");
                }
                else
                {
                    // Update the timeout value
                    Session["SessionTimeout"] = DateTime.Now;
                }
            }
        }
        catch (Exception e)
        {
            Response.Redirect("~/Login");
        }
    }
    else
        Response.Redirect("~/Login");
            
}
 
private byte[] hex2bin(string hexdata)
{
    if (hexdata == null)
        throw new ArgumentNullException("hexdata");
    if (hexdata.Length % 2 != 0)
        throw new ArgumentException("hexdata should have even length");
 
    byte[] bytes = new byte[hexdata.Length / 2];
    for (int i = 0; i < hexdata.Length; i += 2)
        bytes[i / 2] = (byte)(HexValue(hexdata[i]) * 0x10
        + HexValue(hexdata[i + 1]));
 
    return bytes;
}

 
private int HexValue(char c)
{
    int ch = (int)c;
    if (ch >= (int)'0' && ch <= (int)'9')
        return ch - (int)'0';
    if (ch >= (int)'a' && ch <= (int)'f')
        return ch - (int)'a' + 10;
    if (ch >= (int)'A' && ch <= (int)'F')
        return ch - (int)'A' + 10;
    throw new ArgumentException("Not a hexadecimal digit.");
}

Best Joomla Hosting Recommendation


ASPHostPortal.com provides our customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. We offers Joomla hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable Joomla Hosting, we should be your best choice.



Joomla Hosting - ASPHostPortal.com :: Easy Steps To Make Your Joomla Website SEO Friendly

clock December 7, 2016 11:44 by author ben

According to tutorialspoint website. SEO (Search Engine Optimization) is about optimizing a website for search engine. It helps search engines find and rank your site higher than the other sites in response to a search query.

Following are the simple steps used to set the Joomla Website SEO

Step (1) − Click on System → Global Configuration in Joomla administrator. By default Site tab opens up as shown below.

Following are the details of the fields present in the SEO Setting.

  • Search Engine Friendly URLs − Optimizing the URL's to the search engine.
  • Use URL rewriting − Selecting the server, which rewrites the URL's to meet a specific condition.
  • Adds Suffix to URL − Based on the document type the suffix to the URL is added.
  • Unicode Aliases − It selects between the transliteration and Unicode aliases.
  • Include Site Name in Page Titles − Provide your site name on all pages at the beginning or end of the page.

Toolbar

Following are the toolbar options in SEO:

  • Save − Saves your SEO Setting.
  • Save & Close − Saves the SEO Setting and closes the current screen.
  • Cancel − Cancels the SEO Setting in Joomla.

Best Joomla Hosting Recommendation

ASPHostPortal.com provides our customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. We offers Joomla hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable Joomla Hosting, we should be your best choice.



Joomla Hosting - ASPHostPortal.com :: How to Redirect Multiple URLs with .htaccess

clock December 7, 2016 07:35 by author Armend

If you've changed menu items or aliases on your website, the old links will still be indexed on Google until it gets back around to checking them again. This means that if someone is linked to your website in Google and it gives them an old link, they will get a 404 error and won't be able to view anything.


This is where redirecting comes in. We need to redirect all the old links to the new ones to ensure a viewer still gets to the correct page. This can be done individually but can take hours - this is where we can utilise a batch redirect to speed up our process. This basically enables you to take any links with a certain alias and point it to a new alias.

Here is what a default Joomla htaccess file looks like:

##
# @package		Joomla
# @copyright	Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.
# @license		GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

## Mod_rewrite in use.

RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.

To add our redirects, we must ensure we put them before the Joomla SEF rewrites which is generally the last part of the file. See below how you can rewrite a URL.

 

######PTP SEO Redirections -- BEGIN
#301 Redirect Entire Old directories
RewriteRule blog/blog-category-1(.*)$ blog/blog-category-2$1 [R,L]
######PTP SEO Redirections -- END


This basically tells anything that has blog/blog-category-1 in it to redirect to the URL blog/blog-category-2. so the url withblog/blog-category-1/sub-category/item-to-view will automatically update toblog/blog-category-2/sub-category/item-to-view

Below is where we need to add this into our htaccess file - just before the SEF rewrites.

######PTP SEO Redirections -- BEGIN
#301 Redirect Entire Old directories
RewriteRule blog/blog-category-1(.*)$ blog/blog-category-2$1 [R,L]
######PTP SEO Redirections -- END

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.

Best Joomla Hosting Recommendation

ASPHostPortal.com provides our customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. We offers Joomla hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable Joomla Hosting, we should be your best choice.

 

 




Joomla Hosting - ASPHostPortal.com :: How To Create Module in Joomla

clock November 30, 2016 07:08 by author Armend

A module is a lightweight and flexible extension that is used for page rendering. They are used for small bits of the page that are generally less complex and are able to be seen across different components.

You can see many examples of modules in the standard Joomla! install: - menus - Latest News - Login form - and many more.

This tutorial will explain how to go about creating a simple Hello World module. Through this tutorial you will learn the basic file structure of a module. This basic structure can then be expanded to produce more elaborate modules.


File Structure

There are four basic files that are used in the standard pattern of module development:

  • - mod_helloworld.php - This file is the main entry point for the module. It will perform any necessary initialization routines, call helper routines to collect any necessary data, and include the template which will display the module output.
  • - mod_helloworld.xml - This file contains information about the module. It defines the files that need to be installed by the Joomla! installer and specifies configuration parameters for the module.
  • - helper.php - This file contains the helper class which is used to do the actual work in retrieving the information to be displayed in the module (usually from the database or some other source).
  • - tmpl/default.php - This is the module template. This file will take the data collected by mod_helloworld.php and generate the HTML to be displayed on the page.


Creating mod_helloworld.php

The mod_helloworld.php file will perform three tasks:

  • Include the helper.php file which contains the class to be used to collect the necessary data
  • Invoke the appropriate helper class method to retrieve the data
  • Include the template to display the output.


The helper class is defined in our helper.php file. This file is included with a require_once statement:

require_once( dirname(__FILE__).DS.'helper.php' );

require_once is used because our helper functions are defined within a class, and we only want the class defined once.

Our helper class has not been defined yet, but when it is, it will contain one method: getHello(). For our basic example, it is not really necessary to do this - the “Hello, World” message that this method returns could simply be included in the template. We use a helper class here to demonstrate this basic technique.

Our module currently does not use any parameters, but we will pass them to the helper method anyway so that it can be used later if we decide to expand the functionality of our module.

The helper class method is invoked in the following way:

$hello = modHelloWorldHelper::getHello( $params );

Completed mod_helloworld.php file

The complete mod_helloworld.php file is as follows:

<?php
/**
 * Hello World! Module Entry Point
 *
 * @package    Joomla.Tutorials
 * @subpackage Modules
 * @link http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,tutorials:modules/
 * @license        GNU/GPL, see LICENSE.php
 * mod_helloworld is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Include the syndicate functions only once
require_once( dirname(__FILE__).DS.'helper.php' );

$hello = modHelloWorldHelper::getHello( $params );
require( JModuleHelper::getLayoutPath( 'mod_helloworld' ) );
?>

The one line that we haven’t explained so far is the first line. This line checks to make sure that this file is being included from the Joomla! application. This is necessary to prevent variable injection and other potential security concerns.

Creating helper.php

The helper.php file contains that helper class that is used to retrieve the data to be displayed in the module output. As stated earlier, our helper class will have one method: getHello(). This method will return the ‘Hello, World’ message.

Here is the code for the helper.php file:
<?php

/**
 * Helper class for Hello World! Module
 *
 * @package    Joomla.Tutorials
 * @subpackage Modules
 * @link http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,tutorials:modules/
 * @license        GNU/GPL, see LICENSE.php
 * mod_helloworld is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */
class modHelloWorldHelper
{
    /**
     * Retrieves the hello message
     *
     * @param array $params An object containing the module parameters
     * @access public
     */   
    function getHello( $params )
    {
        return 'Hello, World!';
    }
}
?>

There is no rule stating that we must name our helper class as we have, but it is helpful to do this so that it is easily identifiable and locateable.

More advanced modules might include database requests or other functionality in the helper class method.

Creating tmpl/default.php

The default.php file is the template which displays the module output.

The code for the default.php file is as follows:

<?php // no direct access
defined( '_JEXEC' ) or die( 'Restricted access' ); ?>
<?php echo $hello; ?>

An important point to note is that the template file has the same scope as the mod_helloworld.php file. What this means is that the variable $hello can be defined in the mod_helloworld.php file and then used in the $hello file without any extra declarations or function calls.

Creating mod_helloworld.xml

The mod_helloworld.xml is used to specify which files the installer needs to copy and is used by the Module Manager to determine which parameters are used to configure the module. Other information about the module is also specified in this file.

The code for mod_helloworld.xml is as follows:

<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.5.0">
    <name>Hello, World!</name>
    <author>Jervis</author>
    <version>1.5.0</version>
    <description>A simple Hello, World! module.</description>
    <files>
        <filename>mod_helloworld.xml</filename>
        <filename module="mod_helloworld">mod_helloworld.php</filename>
        <filename>index.html</filename>
        <filename>helper.php</filename>
        <filename>tmpl/default.php</filename>
        <filename>tmpl/index.html</filename>
    </files>
    <params>
    </params>
</install>

You will notice that there are two additional files that we have not yet mentioned: index.html and tmpl/index.html. These files are included so that these directories cannot be browsed. If a user attempts to point their browser to these folders, the index.html file will be displayed. These files can be left empty or can contain the simple line:

<html><body bgcolor="#FFFFFF"></body></html>

which will display an empty page.

Best Joomla Hosting Recommendation

ASPHostPortal.com provides our customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. We offers Joomla hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable Joomla Hosting, we should be your best choice.



Joomla Hosting - ASPHostPortal.com :: How to Back Up Your Joomla Website

clock November 24, 2016 10:33 by author ben

According to Tutorialspoint website. In this chapter, we will study about Website backup in Joomla. It allows backup of files, folders and re-opens it in Joomla.

Following are the simple steps used to backup the website in Joomla −

Step (1) − Click on System → Global Configuration in Joomla administrator. You will get the following screen.

Step (2) − Next, click on EJB - Easy Joomla Backup at the left sidebar.

You get a basic editor page for Joomla Backup. Here by default, the Component tab is displayed.

Below we have mentioned the details of the fields present in the Component tab on the page −

  • Exclude files from backup archive − It indicates the name of the files with the path address to be excluded from a backup archive.
  • Exclude folders from backup archive − It indicates the name of the folders with the path address to be excluded from a backup archive.
  • Add 'DROP TABLE' instruction to dump file − It indicates to add drop table instruction to dump files without deleting the tables by selecting either (Yes/No).
  • Add additional tables − It indicates to add additional tables, but it should not have the same prefix.
  • Maximum number of backup files − It indicates the maximum number of backup files.
  • Prefix for archive names − It indicates to use prefixes for archive names of backup file.

Step (3) − After clicking on Permissions tab, you will get the following screen.

Following are the details that are present on the Permissions tab −

  • Configure − It allows the user to edit the user option.
  • Access Administration Interface − It allows the users to access the administration interface.
  • Delete − It allows the user in group to delete the content present in the extension.
  • Download − It allows the user to download the backup archive file.
  • Full Backup − It allows the user to create full backup file permission.
  • Database Backup − It allows the user to create database backup.
  • File Backup − It allows the user to permit creation of file backup.
  • Discover − It allows the user to discover backup files or new entries into the database.

Toolbar

Following are the toolbar options in the Website Backup screen −

  • Save − Saves your Backup of website.
  • Save & Close − Saves the Backup of website and closes the current screen.
  • Cancel − Cancels the created Backup of website in Joomla.

Best Joomla Hosting Recommendation

ASPHostPortal.com provides our customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. We offers Joomla hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable Joomla Hosting, we should be your best choice.



About ASPHostPortal.com

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Sign in