301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. The code “301″ is interpreted as “moved permanently”

Below are a Couple of methods to implement URL Redirection

IIS Redirect

  • In internet services manager, right click on the file or folder you wish to redirect
  • Select the radio titled “a redirection to a URL”.
  • Enter the redirection page
  • Check “The exact url entered above” and the “A permanent redirection for this resource”
  • Click on ‘Apply’

ColdFusion Redirect

<.cfheader statuscode=”301″ statustext=”Moved permanently”> <.cfheader name=”Location” value=”http://www.new-url.com”>

PHP Redirect

<? Header( “HTTP/1.1 301 Moved Permanently” ); Header( “Location: http://www.new-url.com” ); ?>

ASP Redirect

<%@ Language=VBScript %> <% Response.Status=”301 Moved Permanently” Response.AddHeader “Location”,”http://www.new-url.com/” %>

ASP .NET Redirect

<script runat=”server”> private void Page_Load(object sender, System.EventArgs e) { Response.Status = “301 Moved Permanently”; Response.AddHeader(“Location”,”http://www.new-url.com”); } </script>

JSP (Java) Redirect

<% response.setStatus(301); response.setHeader( “Location”, “http://www.new-url.com/” ); response.setHeader( “Connection”, “close” ); %>

CGI PERL Redirect

$q = new CGI; print $q->redirect(“http://www.new-url.com/”);

Ruby on Rails Redirect

def old_action

headers["Status"] = “301 Moved Permanently”

redirect_to http://www.new-url.com/

end

 

Redirect Old domain to New domain (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain. The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Please REPLACE www.newdomain.com in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Redirect to www (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

How to Redirect HTML

Please refer to section titled ‘How to Redirect with htaccess’, if your site is hosted on a Linux Server and ‘IIS Redirect’, if your site is hosted on a Windows Server.

 

When you run System->Tools->Compile from Magento admin panel, and your site stops functioning

Do the following to disable the compile again

Please open the file include.config.php and change the uncommented line to commented and commented the uncommented. Like:

#define(’COMPILER_INCLUDE_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’src’); define(’COMPILER_COLLECT_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’stat’);

This should make the site up and running again.

An eCommerce store needs some special care for converting the site visitor to buyer. Site
analytics data is very important to help this out. In this recipe, we will use Google Analytics
(GA), which is a free service that generates detailed statistics about the visitors to a website
offered by Google. This service was developed from Urchin Software Corporation’s analytics
system, Urchin on Demand, which was later acquired by Google. It has some cool features,
which are obvious for an eCommerce store.

How to do it ?

1. Sign up for a GA account, if you don’t already have one, from http://www.google.com/
analytics.
2. Log in to your GA home page.
3. Create a new profile for your store if you haven’t already done the same.
4. During profile creation, you will see a value name with Web Property ID, which should look something like this: UA-1234567-1
5. Copy this text from GA’s Analytics Settings | Tracking Code page.
6. Log in to your Magento admin panel.
7. Select a configuration scope for your store.
8. Point your browser to System | Configuration | Google API.
9. Expand the Google Analytics tab.
10. Set Enable to Yes.
11. Put your Web Property ID (which looks like UA-1234567-1) from GA in the Account Number text field.
12. Save the configuration.
Thats all. You are done. sign into your google analytics account and check the stats

A Cross-Site Request Forgery (CSRF) is an attack that attempts to cause a victim to unknowingly send arbitrary HTTP requests, usually to URLs requiring privileged access and using the existing session of the victim to determine access. The HTTP request then causes the victim to execute a particular action based on his or her level of privilege, such as making a purchase or modifying or removing information. How Magento is related to that, you ask? Well, the problem starts with an attack called a CSRF attack noticed by Artisan System in the Magento admin panel. The brilliance with this attack is that the person executing it is generally unaware and an authorized user of the website, and thus, the web software has no way to stop the actual actions from occurring. The Magento guys later proposed a simple solution by changing the admin path URL and added some extra programmed checking, validating URLs in vulnerable points.

By using the below technique we will secure our store from these types of attacks

1. Locate and open the local.xml file from /app/etc directory.

2. Now find the code block and change the admin path as I did. I changed it from admin to administration. You can set another string. Try to choose a path as difficult as you can so that bad guys cannot guess it!

<admin>
<routers>
<adminhtml>
<args>
<!—in my case I changed it from admin to administration—>
<frontName><![CDATA[administration]]></frontName>
</args>
</adminhtml>
</routers>
</admin>

Want to add facebook Like button on a product page in magento ?? It is easy to do if if you follow the below steps

Open view.phtml file from app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/catalog/product/view.html

 In most cases, it’s app/design/frontend/default/default/template/catalog/product/view.html

 2. Go to line number 80 and add the following code snippet:

<!—code for facebook like button starts here —>
<?php $src = urlencode($this->helper(“core/url”)->getCurrentUrl()); ?>
<iframe src=”http://www.facebook.com/plugins/like.php?href=<?php echo $src; ?>&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21″ scrolling=”no” frameborder=”0″ style=”border:none; overflow:hidden;width:450px; height:21px;” allowTransparency=”true”></iframe>
<!—//code for facebook like button ends here —>
3. Save it.

4. Now reload any product details page. You should see something like this with a Facebook Like button with count:

If you want to avoid latest messages in the magento admin panel,

Goto System->Advanced->Advanced in admin panel

And set Mage_AdminNotification to Disabled.

This will stop all the latest messages when you login in to admin interface.

 

INSERT INTO `directory_country_region` VALUES
(NULL , “IN”, “Andaman Nicobar”,”Andaman Nicobar”),
(NULL , “IN”, “Andhra Pradesh”,”Andhra Pradesh”),
(NULL , “IN”, “Arunachal Pradesh”,”Arunachal Pradesh”),
(NULL , “IN”, “Assam”,”Assam”),
(NULL , “IN”, “Bihar”,”Bihar”),
(NULL , “IN”, “Chandigarh”,”Chandigarh”),
(NULL , “IN”, “Chhattisgarh”,”Chhattisgarh”),
(NULL , “IN”, “Dadra Nagar Haveli”,”Dadra Nagar Haveli”),
(NULL , “IN”, “Daman Diu”,”Daman Diu”),
(NULL , “IN”, “Delhi”,”Delhi”),
(NULL , “IN”, “Goa”,”Goa”),
(NULL , “IN”, “Gujarat”,”Gujarat”),
(NULL , “IN”, “Haryana”,”Haryana”),
(NULL , “IN”, “Himachal Pradesh”,”Himachal Pradesh”),
(NULL , “IN”, “Jammu Kashmir”,”Jammu Kashmir”),
(NULL , “IN”, “Jharkhand”,”Jharkhand”),
(NULL , “IN”, “Karnataka”,”Karnataka”),
(NULL , “IN”, “Kerala”,”Kerala”),
(NULL , “IN”, “Lakshadweep”,”Lakshadweep”),
(NULL , “IN”, “Madhya Pradesh”,”Madhya Pradesh”),
(NULL , “IN”, “Maharashtra”,”Maharashtra”),
(NULL , “IN”, “Manipur”,”Manipur”),
(NULL , “IN”, “Meghalaya”,”Meghalaya”),
(NULL , “IN”, “Mizoram”,”Mizoram”),
(NULL , “IN”, “Nagaland”,”Nagaland”),
(NULL , “IN”, “Orissa”,”Orissa”),
(NULL , “IN”, “Pondicherry”,”Pondicherry”),
(NULL , “IN”, “Punjab”,”Punjab”),
(NULL , “IN”, “Rajasthan”,”Rajasthan”),
(NULL , “IN”, “Sikkim”,”Sikkim”),
(NULL , “IN”, “Tamil Nadu”,”Tamil Nadu”),
(NULL , “IN”, “Tripura”,”Tripura”),
(NULL , “IN”, “Uttar Pradesh”,”Uttar Pradesh”),
(NULL , “IN”, “Uttaranchal”,”Uttaranchal”),
(NULL , “IN”, “West Bengal”,”West Bengal”);

INSERT INTO `directory_country_region_name` (`locale` ,`region_id` ,`name` ) SELECT ‘en_US’, tmp.region_id, tmp.default_name FROM `directory_country_region` AS tmp WHERE tmp.country_id=’IN’

Manual Installation of Magento

The steps which you must follow in order to complete the Magento manual installation are:

Step 1: Download the latest stable Magento package from:

http://www.magentocommerce.com/download.

Step 2: Upload the package on your hosting account through your cPanel -> File Manager or using an FTP client.

You can learn more about cPanel from our cPanel Tutorial.

There are 2 options where you can place the Magento download file:

  • Either under the public_html folder, which is the main one for your web site content. Then your web site will be accessible directly through your domain.
  • Or under a subfolder, for example if your domain name is called yourdomainname.com and you decide to install the script in the public_html/magento folder, you will open the web site at: http://yourdomainname.com/magento.

Once you upload the package, you can extract it through your cPanel -> File Manager. Using the same tool, please change the file permissions for the Magento files to 755.

Step 3: Create a MySQL database and assign a user to it through cPanel -> MySQL Databases. Remember the database details, since you will need them during the script installation.

The MySQL database is created with your username as prefix – username_databasename, and this is the name you have to use for your application.

Step 4: In our example we will install  Magento in the public_html/magento folder. Once the package is uploaded and extracted and you have a MySQL database, navigate to http://yourdomainname.com/magento:

Click on the check box next to “I agree to the above terms and conditions” and click on the Continue button.

Step 5: Choose the preferred Time Zone, Locale and Currency:

 

Click on the Continue button.

Step 6: Enter the database details: Database Name, User Name and User Password. You can leave the other options intact.
Click on the check box next to “Skip Base URL validation before next step”.

 

Click on the Continue button.

Step 7: At this point you should enter the personal information and the admin login details which you want to use. You can leave the Encryption Key field empty and the script will generate one for you.

Click on the Continue button.

Step 8: Write down your encryption key; it will be used by Magento to encrypt passwords, credit cards and other confidential information.

Well done! Your Magento installation was successfully completed. Now you can navigate to its Frontend or Backend.