How to change Base URL in Magento

Sometimes it may be essential to change the BASE URL of Magento.
(Usually when you want to make a similar copy of Magento on another server!)

There are 2 – 3 simple steps involved in this:

Step 1: Edit old URL values in database
Table: core_config_data
In this table you need to edit the field named value containing specific values in the field named path!
Precisely saying you need to search for web/unsecure/base_url and web/secure/base_url and replace them with new values.

Please refer the images for an example.
OLD Values:
 image

New Values:
image

Step 2: Login to backend and clear Configuration cache!
This might be simply not possible and hence skip to next step!

Step 3: Find All entries of old domain name in the cache folder and replace them one by one.
Magento retains all configuration cache in /var/cache folder.
This step is  good for Advanced Users who can do file search and replace such strings in one shot 😉
If you are migrating a very big site, then this step will be certainly worth.

I use this “Unix Find Command” very useful in searching:


find . -exec grep -q www.magdummy.cws '{}' \; –print

Step 3: Now it’s time to clear the cache! (Normal User)
As already specified in step2, we know that Magento retains all configuration cache in /var/cache folder.
You can clear the entire contents in this cache folder. Magento regenerates all these files when needed.

Step4: View your new site in the browser.
It should now be working fine like the old one 😉

I hope this would work fine for you.
Please leave your comments or I would appreciate any idea that suits best in this case.

Blunders due to auto generated content

Recently I was going through Dmitry’s twitter entries, and I suddenly came across a blog titled “The (Often Amusing) Pitfalls of Auto-Generated Content” and I was really amused about the kind of Ads Google made by combining different keywords.

The same day ironically while I was searching for something I ended up in a Google news page here:
http://www.google.com/archivesearch?q=typo3&btnG=Search+Archives&scoring=t

imageimage image

This literally made me believe that Typo3 CMS is aged over 400 years!

I checked out the three news items listed in year 1605, and it seems like Google considers all numbers with four number digit as year! Well if anyone wants to prove that their company has over 500 year old history, here is an opportunity for you 😉

This is another cool instance of a bad program logic or probably not!

date2cal for mailformplus

In order to set date2cal for mailformplus we need to follow 3 important steps:

1. Include the necessary js and css files

page.headerData.80 = TEXT
page.headerData.80.value (
<script type="text/javascript" src="typo3conf/ext/date2cal/js/jscalendar/calendar.js"></script>
<script type="text/javascript" src="typo3conf/ext/date2cal/js/jscalendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="typo3conf/ext/date2cal/js/jscalendar/calendar-setup.js"></script>
<script type="text/javascript" src="typo3conf/ext/date2cal/js/date2cal.js"></script>
<script type="text/javascript" src="typo3conf/ext/date2cal/js/naturalLanguageParser.js"></script>
<link rel="stylesheet" type="text/css" href="typo3conf/ext/date2cal/js/jscalendar/skins/aqua/theme.css" />

)
# add translations
# French – DEFAULT
page.headerData.90 = TEXT
page.headerData.90.value = <script type="text/javascript" src="typo3conf/ext/date2cal/js/jscalendar/lang/calendar-fr.js"></script>

2. Create the target input box and the calendar trigger button

<input type="text" name="datebox" id="datebox" value="###value_datebox###" tabindex="13" maxlength="16" size="9"/>
<img id="datebox_trigger" alt="Calendar" title="Calendar" style="cursor: pointer; vertical-align: middle;" src="typo3conf/ext/date2cal/res/calendar.png"/>

3. Write the calendar instantiation code using JavaScript
(The id of “inputField” and “button” should match the textbox and trigger button)
NOTE: this code must be executed after the above input boxes are loaded!

<script type="text/javascript">
    Calendar.setup({
        inputField     :    "datebox",      // id of the input field
        ifFormat        :    "%d/%m/%Y",       // format of the input field                   
        align          :    "Bl",           // alignment (defaults to "Bl")
        button         :    "datebox_trigger",   // trigger for the calendar (button ID)
        singleClick    :    true,           // single-click mode
    });
</script>

That’s all now you should be able to view the calendar if you click the image!!!

Dynamically change class attribute of body tag using typoscript

This is a small note about how we can change the class attribute of body tag using typoscript.

# bodyTag
page.bodyTag >

page.bodyTagCObject = TEXT
page.bodyTagCObject.data = levelfield:-1 :, myfeildname, slide
page.bodyTagCObject.wrap = <body class="myclass_|">

Well here I am using a custom field added to pages table. If you wish to use the page id you may try using this code below:

# bodyTag
page.bodyTag >

page.bodyTagCObject = TEXT
page.bodyTagCObject.data = field:id
page.bodyTagCObject.wrap = <body class="myclass_|">

This way you may expect body tags like:
<body class="myclass_1">
<body class="myclass_2">

Some of the most important things to know about Linux

 

These settings are applicable to Redhat/ Fedora / CentOS and I am not aware if this holds good even on other Distros.

Important File / Folder Locations

  • Location of HTTPD (Apache) Configuration File:
    /etc/httpd/conf/httpd.conf
  • Location of PHP Configuration File (php.ini):
    /etc/php.ini

Service Related Information

Enabling / Disabling Services
The chkconfig command can be used for enabling / disabling services on Redhat based linux distributions.

EX: # chkconfig httpd –add
EX: # chkconfig httpd on
EX: # chkconfig –list httpd
EX: # chkconfig httpd of
EX: # chkconfig httpd –del

Starting / stopping / a service

service <service name> start/stop
EX: # service httpd stop
EX: # service httpd start