Friday 14 March 2014

Pointer Domains

Pointer Domains

IMPORTANT: These instructions will work only for Magento versions 1.4.0.1 and higher.

  • Ensure that the domain name that you wish to use is pointing to the server.
  • NOTE: The Pointer Domain will be pointing at the Primary Domain where your Magento installation is located.
  • Edit the .htaccess file in the document root of your Magento Installation and enter the following just above the line RewriteEngine On :
    • Replace .*newstore.* with the domain name of your new store, keeping the dots and stars.
    • Ensure that MAGE_RUN_CODE matches the Code you wrote down when you created the new website above.
  •     SetEnvIf Host .*newstore.* MAGE_RUN_CODE=newstore SetEnvIf Host .*newstore.* MAGE_RUN_TYPE=websitecode
    • where newstore specifies the domain name of your new store, and websitecode specifies the store code created in Magento.
  • NOTE: The Pointer Domain will be pointing at the Primary Domain where your Magento installation is located.
  • Edit the .htaccess file in the document root of your Magento Installation and enter the following just above the line RewriteEngine On :
    • Replace .*newstore.* with the domain name of your new store, keeping the dots and stars.
    • Ensure that MAGE_RUN_CODE matches the Code you wrote down when you created the new website above.
  •     SetEnvIf Host .*newstore.* MAGE_RUN_CODE=newstore SetEnvIf Host .*newstore.* MAGE_RUN_TYPE=websitecode
    • where newstore specifies the domain name of your new store, and websitecode specifies the store code created in Magento.

    • You have successfully set up your pointer domain to work with Magento. You may now load your new domain in your browser and begin developing your new store.

Tuesday 11 March 2014

MY SQL - Magento Base URL

I accidentally changed the "default store views" base URL's thinking I was on another store view.
To correct this I did the following:

Areas in red are the commands to add to mysql via putty - see other posts regarding putty logging in ect here http://nginxputtymagento.blogspot.co.uk/

1) Log into Putty using the Root login

2) open MySql with the command: mysql

3) use magentodatabasename; - > you need to type the word "use" followed by your data base name - this can be located in the config file under you SSH/FTP in the location: app/ect/config.xml - this will show you your data base name, user name and pass word.
so you need to type the word use followed by the data base name followed by a semi colon ; see below. (swap your databasename with your actual database name)
use yourdatabasename;

4) add the full line to putty below:
select * from core_config_data where path like '%base%url%';

5) Use the full command below - only changing the url i.e. http://yourdomaingoeshere/
add line
update core_config_data set value = 'http://somedomainname/' where path = 'web/unsecure/base_url';


6) do the same as above with the line below and add - again you need to change the url to your own!
update core_config_data set value = 'http://somedomainname/' where path = 'web/secure/base_url';

7) this is now done, your website should now work from the domain/url you added in to the two lines of code above.

trouble shooting -
* check the data base name in step 1
* check you used semi colons at the end of step 1 and the word "use" (with out brackets)
* check the url added in lines 5 and 6 you should have changed these to your own website address
* clear your cache - when I do this I always download it first as a back up it is found in your var/cache folder
you need to delete all folders within the folder cache. - remember to back up first!

your site should now open at the requested url.

adding a data base to putty mysql

login putty
type mysql

type
create database typedatabasenamehere;
 
should say : Query OK, 1 row affected (0.16 sec)
 
 
add: 
grant all privileges on typedatabasenamehere.* to 'typeusernamehere'@'localhost' identified by "typepasswordhere"; 


should say : Query OK, 1 row affected (0.16 sec)
 
add: 
flush privileges;
 
 
add:
exit; 

How to connect to a mysql data base using putty

Just a simple exercise for this one. At the command prompt, type
mysql -u username -p -- dbname

where username is the username associated with your MySQL database
and dbname is the database name.

You'll then be prompted for your password.
This prompt should then appear, indicating you are now connected to the database.

You'r Done.

putty download page

putty download page http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

I downloaded the first one:


For Windows on Intel x86
PuTTY: putty.exe