I was asked recently how do you add a product straight to your Magento cart from a link that is external to your Magento store. It turns out the answer is quite straight forward BUT there are some things you need to consider.

To add a simple product to your cart use this link


  • obviously yourwebsite.co.uk is the URL to your Magento store
  • product=85 replace 85 with the Magento ID of the product you want to be placed in the cart. You can find this id in the admin – > Catalog > Manage Products the ID is contained in the far left column.
  • qty=1 the 1 represents the quantity of products you want added to the basket. If you want more than 1 increase the number here.

This allow you to directly add simple products to a shopping basket. You may want to do this from a blog, an email or even an advert campaign.

Something to consider

1. If the person adding this to the basket has never been to your website before then they will be presented with the ‘Cookies’ page. You may not spot this error as the chances are you have a cookie on your machine for past test orders you have created but first time visitors will see this using the link created. You need to turn off the ‘Redirect to Cookies Page’ if a cookie is not detected. To do that go to > Configuration > Web > Browser Capabilty Detection > and select  ’No’ in the option ‘Redirect to CMS-page if Cookies are Disabled’

Posted in Uncategorized | Leave a comment

Despite your best endeavors and skill level, regular website backups are essential. Below we outline a simple method for taking regular backups of you Joomla Website.

Joomla is a dynamic content management system, and as such uses a MYSQL database to store the actual ‘data’ of your website. As well as your database, various files are also critical to the operation of your site. A sound backup strategy takes this into account. It’s no good only taking a backup of you files, but not bothering with your database.

So, when would it be imperative to take a website backup? Under some of the following situations:

  • You are about to install a new Extension for Joomla
  • You are about to patch/upgrade Joomla
  • Your regular daily, weekly or monthly backup strategy
  • Various other times

So, how do you do it.. easily? We’ve found the best success using the free tool https://www.akeebabackup.com/
The component is simple to use as well as install. However, a few VERY important points. While this component makes taking a backup simple, it’s fairly useless if you do not download the backup that is created to another location, like you own computer. So, be sure to take special note of that.

Serverside/hosting backups are also a must when it comes to a backup strategy. You can read more about the pitfalls and choices to make in a host by taking a look at the following article: Are Backups Important to You?

Again, we cannot stress how important regular backups are. https://www.akeebabackup.com/ is a purpose built component designed to assist you in this regard. Make it one of your must have components as well. https://www.akeebabackup.com/ backups can also be used to assist you in migrating/moving your Joomla website.

Posted in Backup, Content Management System, eCommerce, Joomla | Tagged , , , , , , | Leave a comment

Never redirect to another domain
Redirecting to another domain is not a 100% guarantee that you’ll be banned from search engines. But it is a very common spammer trick used in conjunction with doorway pages and cloaking. If you set up a redirect that goes to a new domain, you need to write it as a 301 HTTP redirect, not a 302 or meta refresh. This tells the search engine that this redirect is permanent, and they should change to the new domain in their directory.

Be Careful Redirecting to New Domains – You Could Be Banned
Since this trick is commonly used by spammers, it’s a very good idea to avoid doing it. Search engines can be very hard to get back into if your site is banned by mistake.

Never link invisible images
Invisible images are images that are 1×1 pixels in size and cannot be seen by the naked eye on a Web page. Since links are given some priority in ranking a Web page, linking images that cannot be seen by your customers appears to be aimed only at search engine spiders.

Don’t Link Single Pixel Images – Your Site Will Be Banned
This is similar to hiding text or displaying different content to search engines than to your customers. And don’t assume that search engines can’t read CSS or HTML tags that resize full-sized images. If you do this to optimize your pages, your site will be banned.

Never include invisible text on your pages
Hiding text by making it the same color as the background color may fool your customers, but it won’t fool search engines. Another variation of this is where you make the font size so small that it’s unreadable by the naked eye.

Don’t Hide Text – Your Site Will Be Banned
Search engines understand CSS and font and background colors. They also recognize that a font-size of 1px is not going to be readable. Text that is hidden from your readers but visible to search engines is considered spam and will get your site banned.

Never create doorway pages
Doorway pages are very simple HTML pages that are written to optimize heavily on one or two keywords or keyword phrases. And they are programmed so that search engines spiders see them, but regular readers are taken to the real site.

Don’t Use Doorway Pages – Your Site Will Be Banned
Doorway pages are designed to trick search engines into thinking that the site has a specific keyword relevance that it may or may not have and they are pages meant to be seen only by the search engine. So, most search engines will ban sites from their directory when they discover you use them.

Never display different content to a spider than customers
This is often called cloaking because it is an effort to cloak what your site delivers in something that might be seen as more palatable to search engines. It can be very tempting to use cloaking, but while it might give you better results at first, search engines don’t like it.

Don’t Cloak Websites – Your Site Will Be Banned
Search engines want to provide a resource of information that is real, not something that has been doctored to give artificial results. When they discover that your site is cloaking, it will be removed from the search directory.

Posted in Content Management System, Search Engines | Tagged , , , , , , , | Leave a comment

Write great content
Great content is where it all starts. You can have all the keywords in the world, but if your content is no good, people won’t stick around on your site and search engines won’t find your site valuable.

Write unique content
Unique content is important too. You need to provide content that has different information than what is on other sites and other Web pages.

Add new content all the time
Sites that have new content added on a regular basis are seen as more reliable than sites that rarely do. This also helps you to increase the amount of relevant content on your site, which also improves your rankings.

Create a great keyword phrase
The first thing you should do when working on search engine optimization is find a great keyword phrase for that page. You shouldn’t try to optimize your entire site to one keyword phrase – instead focus on writing pages for specific keywords and phrases.

Choose a phrase that is popular, but not too popular 
When trying to decide on a keyword phrase, you want to find one that is popular but not extremely popular. This may seem counter-intuitive, but the reality is that extremely popular keywords are very desirable and so very competitive. It’s better to try to optimize for keywords that you can rank higher. You’ll get more pageviews from a less popular keyword when you’re on the first or second page of the search engines, than from a super popular keyword that you only make it to page 50 of search engines.

Write an accessible site
Accessible HTML is accessible to both search engine spiders and screen readers. The more accessible you make your pages, the easier it will be for search engines to read and rank your pages.

Use the keyword phrase in your title tag
The title tag is one of the most important tags on your Web page. And placing your keyword phrase in the title tag, preferably at the beginning, is very important to get that phrase into the search engines. Plus, that puts your keyword phrase as the link in the search engine index.

Get a domain with your keyword phrase 
Putting your keyword phrase in your domain name is a great way to optimize for that phrase.

Use the keyword phrase in your URL
Even if you can’t get your keywords into your domain name, you can put them into your URLs. Search engines read the URLs and assign value to the text they find there.

Use your keyword phrase a lot, but not too much
The ratio of your keywords to the rest of the text on your page is called the keyword density. It’s important to repeat your keywords in your document, but not too much. Keyword density should be between 3 and 7% for your primary keyword phrase and 1-2% for any secondary keywords or keyword phrases.

Posted in Browsers, Content Management System, Search Engines | Tagged , , , , , | Leave a comment

SEO Techniques in Magento

1. First, make sure you have installed the latest version of Magento.

2. Then, go to this path: System => Configuration => Web => Search Engines Optimization

  • In the “URL Options” menu, set the “Add Store Code to URLS” option to “No” so that store codes are not added to URLs.

  • In the “Search Engine Optimization” menu, set the “Server URL Rewrites” option to “Yes” to remove “index.php” from your URLs and generate more search engine friendly and readable URLs.

3. Go to this path:

System => Configuration => Design => HTML Heads

  • Change the “Default Robots” setting to “INDEX, FOLLOW” so that search engines can index your website and show it in search results.

  • In the “Default Title” and “Default Description” boxes, write the default title and description that you want your pages to have just in case you forget to write a title and description when creating a page. This will ensure that no page has blank information, which would make it more difficult to index.

4. Make sure your e-store is directly available to search engines by creating a “robots.txt” file containing commands that direct search engines to the URLs you want to appear in search engine results and also indicates which you don’t want to appear. Here’s a link to a good article that explains how to create this file and how to write commands in it.

5. Make sure you write good descriptions for your new categories, products, and pages that include several words, so that search engines can accurately reveal those pages when potential customers shop for related ideas or items.

6. To avoid duplications in URLs, go to this path:

System => Configuration => Catalog => Search Engine Optimization

and set “Use Categories Path for Product URLs” to “No”, as shown below:

7. To prevent Magento from generating duplicate content when you want to show the same product in multiple categories, set both “Canonical Link Meta Tag” fields to “Yes” on that same page, as shown below:

8. You can also use category and product images to attract visits from search engines to your e-store by doing the following:

  • Use meaningful names for your images, i.e. “sony-lcd-television-42inch-black.jpg” instead of “photo234.jpg”.
  • When adding an image of a product, write a meaningful description to be used as the “title” and “alt tag” for the given image, i.e. “Sony Vaio Laptop,” as shown below:

9. When adding a category, a product, or page, create a “URL Key” so that your e-store URLs become more search engine friendly, as shown below:

10. To help Google index your site, generate a Google Sitemap automatically by going to this path:

System => Configuration => Google Sitemap

  • In the “Generation Settings” box, enable sitemap generation and change its frequency according to your e-store update frequency. This will allow Google to get your site’s most up-to-date sitemap that includes all new items.
  • You can also modify sitemap settings upon adding a new category, product, or page, so that your sitemap includes all of your new items, as shown below:

11. You can also easily add a “Google Webmaster Tools verification tag” in Magento by going to this path:

System => Configuration => Design => HTML Heads

Put your “Google Webmaster Tools verification tag” in the “Miscellaneous Scripts” box as shown below:

12. Enable “Google Analytics” by going to this path: System => Configuration => Google API

Set “Enable option” to “Yes” and type your Account Number in the box as shown below:

By following these 12 tips, you are sure to optimize your site for maximum visibility to customers, getting them directly to the products they’re looking for more quickly. Ultimately, better SEO should mean more customers and more conversions, so it’s likely worth just changing these few elements to boost your e-commerce business.

Posted in Content Management System, eCommerce, Magento Commerce, Search Engines, Security, Software Updates | Tagged , , , , , , , | Leave a comment

1. Turn off Logging

Most Magento developers are unaware that there is an extended mechanism for logging within Magento and that it is turned on by default. This logging mechanism was once set to be on by default and therefore, setting it off in the next release can potentially break havoc across the tens of thousands of Magento websites or extensions out there. It will probably won’t affect as many sites as one would think but this is the answer I got from Magento’s chief architect, and is a solid consideration for such software with the large base of installations as Magento.

So, what can you do about it? simple: turn it off. In the Magento Admin Panel go to “System” > “Configuration”, from the left panel choose “Advanced” from the “Advanced” Panel at the bottom left. Look for the module “Mage_Log” and set it to ‘disable’ and save.

2. Turn of Compulation

Compilation is a new feature in Magento version 1.4.x.x and above. This feature actually existed as beta and was turned off by default in previous versions of Magento but from version 1.4.x.x and on it is now turned on by default and ready for production. This new feature compiles files and scopes into more easily accessible blocks of HTML. According to the Magento Core team, using this feature provides “between 25% to 50% better performance depending on the page requested.”

To enable, go in the Magento Admin Panel to “System” > “Tools” > “Compilation” and click on the “Run Compilation Process” button.

3. Combine CSS and Javascripts

Combining files feature is now built in by default in Magento version 1.4 and above. Notice that in some versions this is still in beta and it does not compress or minify the files, only combines them. In any case, this is a great features for performance and always shows significant improvement in the browser rendering time.

To turn this on, go in the Magento Admin Panel to “System” > “Configuration”, from the left navigation panel, click on “Developer” link from the “Advance” panel (all the way at the bottom). Look for the two tabs “Javascript Settings” and “CSS Settings” and you want to select “Yes” for the Merge files options in both.

If you need additional horse power you may want to look at Fooman speedster extension which merges and compresses Javascript and CSS files on the fly. The Fooman extension also uses advanced caching mechanism for the compressed files and has more options to tweak for the more advanced store owners out there.

4. Enable Flat Catalog

Magento inherently uses the EAV database module. This means that each product or category has information spread throughout dozens of tables. Every time that a product page is requested or a category page is requested a big join query is made to gather all these pieces of information and build the product object. While extremely flexible this feature is a huge bottleneck for performance – this is where the flat catalog comes handy. The flat catalog essentially allows Magento to build the same objects with one single DB query from one single DB table.

To turn this feature on, go in the Magento Admin Panel to “System” > “Configuration”, choose “Catalog” from the “Catalog” panel. Expand the top panel which should say “Frontend” and at the bottom you should see two options “Use Flat Catalog Product” and “Use Flat Catalog Category”. Set both to Yes.

Note: if these options are grayed out, you probably need to enable indexing for these features (In the “System” > “Index Management” page).

5. Avoid using layered navigation if not needed

Layered Navigation is actually a great feature for shopping carts with a large catalog. It helps your users find the right product by narrowing down the product attributes it wishes to buy. These feature unfortunately slows down Magento significantly, hence if you do not use it or understand what it is, go ahead and disable it until you are ready.

In order to disable this feature, set the attribute ‘Anchor Category’ to ‘No’ for all your categories.

6. Avoid to many extensions

This tip is trivial, but I often see this mistake been made by existing store owners. To install a new Magento extension is so easy these days, that many simply go for it and try out a variety of extensions. The problem is that the vast majority of these extensions may not be programmed with performance in mind, hence they are a hindrance on the site performance. Even worst, some extensions may introduce security wholes that you may never know about until it is too late. Hence, it is always a safe practice to use as little extensions as you need and never leave any extension just because you never had the time to remove it. Less extensions also means easier upgrades, which is my next performance tip.

7. Use the latest version of Magento and update often

Another trivial performance tip that many store owners skip for the sake of adding features or lack of resources is upgrading often. Magento is still in its infancy as a shopping cart platform and there are tons of features that are now being discussed and added into the core code. In the last 12 months the Magento Core team has been putting a lot of effort in closing bugs and adding performance enhancements, like the flat catalogs, caching & indexing mechanisms, and now the compilation mechanism. So, if there is a new stable version available out there you should focus on upgrading your core platform and learn in what new ways you will be able to boost performance, and most importantly sales!

Posted in eCommerce, Magento Commerce, Security | Tagged , , , , , , , , | Leave a comment

Posted in eCommerce, Magento Commerce | Tagged , , , | Leave a comment

Future of Xcart and Magento

Xcart is not OOP product, it is based on PHP functions, just like outdated osCommerce.

Current Xcart branch is the last in history of the Xcart, so if you will purchase Xcart today, it means that in several month/years (the date is unknown) you will stay with completely outdated, “zombie” product and it will be needed to migrate to “LiteCommerce/Xcart 5/Xcart Next” platform.

Here is some most important statements from this FAQ:


Will you release new X-Cart 4 versions? Although we will release new X-Cart 4 versions, the releases will include bug-fixes only, no new features. The reason is that we are working on a brand new e-commerce platform (also known as “X-Cart 5″) and it doesn’t make sense to develop a feature for two platforms at the same time.

When will you release “X-Cart 5″? If you are referring to the future X-Cart solution based on the new platform, there is no release date yet.

Will X-Cart 4 themes and modifications work for “X-Cart 5″? No, the new platform has a completely different architecture and is not compatible with themes and custom modifications made for X-Cart 4.

Will I be able to upgrade my X-Cart 4 store to X-Cart 5 later? Since the platforms have a completely different architecture, there will be no automatic upgrade scripts. However, a data migration tool importing your product data from XC4 may be released later.

Does “X-Cart 5″ have less features than X-Cart 4? Technically – yes, the new platform itself has less features than X-Cart 4.

Will there be a Pro version of “X-Cart 5″? Unfortunately, in the near future we don’t plan to release a “Pro” version of the new platform. Perhaps, it will be released as a module later either by us or by a third-party developer.


So as you see, in any case you will need to migrate all your customizations, designs, customers, orders history, products reviews, email templates and URLs structure (important for SEO) in the nearest future to the new platform with limited features.

Magento is supported not only by PayPal & eBay, Magento have giant ecosystem of developers, designers and modules vendors. There are more than 4500 modules for Magento in MagentoConnect marketplace, and 30% of all these Magento modules are free. The future of Magento is bright and clear for everyone. More and more online marketers choose Magento as the platform for their eCommerce businesses.


Magento VS Xcart Comparison

Architecture Magento: Modern, modular architecture based on Zend Framework. Xcart: Obsolete architecture, functions based and not modular.

Multi-store capabilities Magento: Stable multi-store solution. Xcart: Not supported by Xcart 4 and 5. Xcart 5 will not have Pro version, which means that it will have no milti-vendor capabilities as well.

Upgrades & migration to the new version Magento: 100% upgradable architecture. It is easy to upgrade Magento and Magento theme design. Xcart: Upgrade procedure is almost manual (.DIFF files application). It will be not possible to upgrade to Xcart 5 from Xcart 4.

Future of the product: Magento: Clear roadmap and clear release dates. Investments from PayPal & eBay. Xcart: Not clear strategy of product development. No release dates available at the moment. Development of current Xcart 4 product is frozen.



Today over 100,000 merchants worldwide use Magento, including such big brands like Skype, Olympus, Nokia, Samsung, Lenovo, Ford, Tool King, FOX, GoodYear, Ford and many others.

Choosing right eCommerce platform for your business today, you invest money in your company. Magento is right solution, you will avoid a lot of troubles and pitfalls in the future with Magento. Here are some other “Magento VS Xcart” articles that compare eCommerce features and could be useful:

- Templatemonster.com: Deeper Look into X-Cart eCommerce EngineMolotovbliss.com: Magento VS X-Cart

Posted in eCommerce, Magento Commerce, News, Software Updates | Tagged , , , , | Leave a comment

There are many old tutorials which are out of date and simply do not work. We have tested this solution with Magento version 1.5 and 1.7. Free sample products or free tester products are ideal for e-commerce websites that require giving their customers for example tester materials or sample perfumes for instance.

You can restrict the amount of free sample products you want give out to your clients because you do not want people to have let’s just say a 100 free sample products. instead this tutorial will restrict the sample product to 5 but you can edit the code you change it to whatever you feel is the right amount.

1. Firstly you will need to create a file called getSample.php in the root of your Magento installation folder and populate it with the following code.


001 <?php
003 ini_set(‘display_errors’, 1);
004 error_reporting(E_ALL);
006 //print_r($_POST);
008 require_once ‘app/Mage.php’;
009 Mage::app();
013 Mage::getSingleton(“core/session”, array(“name” => “frontend”));
014 Mage::getSingleton(‘core/session’)->setSampleError(“”);
015 // Store users session
016 $session = Mage::getSingleton(“customer/session”);
018 //Store cart items
019 $totalNumOfCartItem = Mage::getModel(‘checkout/cart’)->getItemsQty();
021 //Store cart items
022 $theitems = Mage::getModel(‘checkout/cart’)->getItems();
024 $thecount = 0;
026 foreach($theitems as $ti){
028 $thename = $ti['name'];
030 $test = strpos($thename,’Free Sample’);
032 if($test !== false){
033 $thecount = $thecount+1;
034 }
036 }
038 if(isset($_POST['name'])){
039 $name = $_POST['name'];
041 $id = $_POST['id'];
042 if(isset($_POST['simpleid']) && !empty($_POST['simpleid'])){
043 $simpleid = $_POST['simpleid'];
044 }
045 }
046 if(isset($_GET['name'])){
047 $name = $_GET['name'];
048 if(isset($_GET['simpleid']) && !empty($_GET['simpleid'])){
049 $simpleid = $_GET['simpleid'];
050 }
051 $id = $_GET['id'];
052 }
054 // retrict shopping cart to only allow 5 samples
055 if ($totalNumOfCartItem <= 4)
056 {
057 $theproduct = Mage::getModel(‘catalog/product’)->load($id);
059 if($simpleid){
060 $thesimple = Mage::getModel(‘catalog/product’)->load($simpleid);
061 }
063 if($thecount < 2){
065 // instatiate Product
066 $product = Mage::getModel(‘catalog/product’);
067 if($simpleid){
068 $product->setSku($thesimple->getSku().”*”.rand());
069 } else {
070 $product->setSku($theproduct->getSku().”*”.rand());
071 }
072 $product->setName(“Sample of “.$name);
073 // $product->setDescription(“Sample of “.$name);
074 $product->setShortDescription($name.” – Sample”);
075 $product->setPrice(00.00);
076 $product->setTypeId(‘simple’);
078 $product->setImageUrl($theproduct->getImageUrl()); // set the images from the original product
079 $product->setThumbnailUrl($theproduct->getImageUrl());
080 $product->setImage($theproduct->getSmallImage());
081 $product->setMediaGallery (array(‘images’=>array (), ‘values’=>array ()));
082 $product->addImageToMediaGallery($_SERVER['DOCUMENT_ROOT'].”/media/catalog/product”.$theproduct->getSmallImage(), array(‘image’,'small_image’,'thumbnail’), false, false);
083 $product->setAttributeSetId(9); // need to look this up
084 $product->setCategoryIds(“15″); // need to look these up
085 $product->setWeight(21212121.21);
086 $product->setTaxClassId(2); // taxable goods
087 $product->setVisibility(1); // catalog, search
088 $product->setStatus(1); // enabled
089 // assign product to the default website
090 $product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
093 // get product’s general info such price, status, description
095 $stockData = $product->getStockData();
097 // update stock data using new data
098 $stockData['qty'] = 1;
099 $stockData['is_in_stock'] = 1;
100 $stockData['manage_stock'] = 1;
101 $stockData['max_sale_qty'] = 5;
103 // then set product’s stock data to update
104 $product->setStockData($stockData);
105 //die();
107 // call save() method to save your product with updated data
108 $product->save();
111 header(“Location: /checkout/cart/add/product/”.$product->getId().”/”);
112 }
113 }
115 else
116 {
117 Mage::getSingleton(‘checkout/session’)->addError(“You are only allowed a maximum of 5 sample products”);
119 header(“Location: /checkout/cart”);
120 }
121 ?>

The above code is simply the function which will create sample products for you on the fly. Also not that in this example we have assigned each sample product with a ridiculous weight because the client offered the sample product and the shipping of the sample products for free meaning we had to create a table rate for the shipping method which did not interfere with the other shipping logic so that anything that exceeds 21212121 will have free shipping.

2. Next you will need to create a button where you want people to add a free sample product in the shopping basket. I have placed my sample button in the list.phtml and placed the button in both my list view and grid view.

1 <form action=”/getSample.php” method=”post”>
2 <input type=”hidden” name=”id” value=”<?php echo $_product->getId() ?>” />
3 <input type=”hidden” name=”name” value=”<?php echo $this->htmlEscape($_product->getName()) ?>” />
4 <input type=”image” name=”getsample” alt=”Get Sample for <?php echo $this->htmlEscape($_product->getName()) ?>” src=”<?php echo $this->getSkinUrl(‘images/your_theme_name/sample-btn.jpg’) ?>” />
5 </form>

The above will execute the getSample.php and add a sample product to your shopping basket whilst still allowing you to purchase other products from the Magento shop.

Posted in Magento Commerce | Tagged , , , | Leave a comment
This is a core hack. Files you change as described on this page will be overwritten during updates of Joomla!

This tip explains how to move your configuration.php file outside of your webroot as well as making it unwritable by the server. That makes it nearly impossible for someone to corrupt or gain access to the information in the file.

The first step is to move the file. If you use a host with cPanel, then your webroot is /home/USERNAME/public_html, where USERNAME is your cPanel username. (The tip is easy to adapt to other hosting environments too, ask us, if you don’t know, how!) Joomla can access files located at /home/USERNAME, but those files cannot be directly accessed from the Internet. Login to your favorite FTP program and download your configuration.php from /home/USERNAME/public_html/configuration.php . Rename it to ‘site.conf’ then upload it to /home/USERNAME/site.conf.

Now that we’ve uploaded it to the new location we need to edit the original configuration.php file. Open it in your favorite text editor and replace the contents of the file with the following:

		 require( '/home/USERNAME/site.conf' ); ?>

Make sure to replace USERNAME with your cPanel username. Then upload the new file to /home/USERNAME/public_html/configuration.php. At this point your site should still function normally.

Next, we need to make the file unwritable by the server. Most FTP programs allow you to do this. Right-click on the /home/USERNAME/site.conf file and select the option to edit permissions (normally ‘Permissions’ or ‘Info’) andlets the server read the file without any problems, but it will not be able to edit the file.

If you ever need to edit the file you will need to change the permissions back to 644 before making your changes.

In Joomla 1.5 and newer you can do other things to archive the same result.

Joomla 1.5

  • Create a directory in your domain outside of your public_html directory. You can name it anything you want but it should reflect the site name in some way. We used the name design2-files for the directory name in this example. Note: If you have multiple Joomla installs then each Joomla install you have should have its own directory outside of public_html to contain its configuration.php file.
  • Place a copy of your current configuration.php file, completely unaltered and NOT renamed into this directory. I have permissions set at 644 on the file in this directory and the directory set to 755 permissions. Permissions of 444 on the configuration.php file are also acceptable if that is the current permissions of your configuration.php file.
  • Go to the root/includes/ directory in your Joomla install, backup the file defines.php.
  • Now open the file defines.php in your favorite editor
  • Around line 26 you will see this:

    Replace it with this:


    If Joomla has been installed in a subdirectory under public_html ( public_html/subdirectory/ ) then replace it with this

    The /design2-files is our example subdirectory. Replace this with the name of your subdirectory.
  • Repeat these exact same steps with the defines.php file that is located in the root/administrator/includes/ directory. If you don’t do this access to your admin area will be prevented.
  • Go to the root of your installation and rename the configuration.php file to something like somefile.html while testing the modifications.
  • Using a browser, go to your website and test as many pages as you can to make certain it is working correctly.
  • When you are satisfied everything is working properly, delete the old renamed configuration.php file from the root of your Joomla installation.
  • Retest your website thoroughly to make sure everything is still working correctly.
  • Make sure you add the new directory (design2-files in our example) with the configuration.php file in it to your backup job so it doesn’t get missed.
  • You can access and modify the Joomla configuration as you would normally from the Joomla administration area. This access will not create a new configuration.php file, but will modify the moved configuration.php file.

Joomla 1.6, 1.7

Overriding defines.php

Starting with version 1.6, it is possible to provide a localized version of the files that reside in includes/defines.php (i.e. includes/defines.php and administrator/includes/defines.php). This makes it possible to move a variety of files outside of document root.

The actual process is quite simple, but it is advisable that you make sure you know what you’re doing before proceeding.

To start, copy the file {ROOT}/includes/defines.php to {ROOT}/defines.php and the file {ROOT}/administrator/includes/defines.php to {ROOT}/administrator/defines.php.

Once you have copied the files, it is necessary to edit both new files and add the lines:

define('_JDEFINES', 1);
define('JPATH_BASE', dirname(__FILE__));

underneath the defined(‘_JEXEC’) or die; line.

Setting the path to configuration.php

Now that you have created override files, you can edit them and provide new locations for various directories. The directory we’re interested in is JPATH_CONFIGURATION. The default value is defined as:



To put the configuration file in another location, move the file to its new home and specify the new path. As an example, if your files were in /home/exampleuser/public_html and you wanted to put configuration.php in /home/exampleuser/configuration.php, you would change the JPATH_CONFIGURATION define line to:

define('JPATH_CONFIGURATION', '/home/exampleuser');

Make this change in both files, move the configuration.php file and you’re done.

Posted in Joomla, Security | Tagged , , , , | Leave a comment