Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

setting up test website
 
d3z1gnr
Jr. Member
 
Total Posts:  10
Joined:  2009-11-14
 

hi guys,

i am wanting to setup a test/preview site for my client (they wish to be very involved in the design). at this stage i am thinking of using http://www.theirsite.com/preview as the location for the base magento installation.

question, once client has setup their catalog and site design is signed off, how easy is it going to be to then move magento up a level to the root folder? is it simply a case of relocating files or will there be server issues i will need to address.

any thoughts would be greatly appreciated.

(this app looks absolutely wicked by the way !!)

mike

 
Magento Community Magento Community
Magento Community
Magento Community
 
d3z1gnr
Jr. Member
 
Total Posts:  10
Joined:  2009-11-14
 

sorry fo the bump, just wanted to know if anyone was able to help with this question?

mike

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial Web Host
Guru
 
Avatar
Total Posts:  364
Joined:  2007-11-08
Phoenix, AZ
 

Hi Mike,

d3z1gnr - 22 February 2010 09:49 AM

question, once client has setup their catalog and site design is signed off, how easy is it going to be to then move magento up a level to the root folder? is it simply a case of relocating files or will there be server issues i will need to address.

It’s very easy to move the application. 

Assuming you follow proper coding protocol and use no absolute URL’s in your design and programming, you’ll simply move the files to the root directory and update the base_url and secure_base_url in the database.  The application relies on those entries for properly setting the paths of everything else.

Hope everything goes well for you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
d3z1gnr
Jr. Member
 
Total Posts:  10
Joined:  2009-11-14
 

sweet. that sounds pretty easy. thanks heaps for the response.

mike

 
Magento Community Magento Community
Magento Community
Magento Community
 
bitflip
Sr. Member
 
Total Posts:  149
Joined:  2009-05-17
UK
 

Personally, I prefer to keep Magento in it’s own directory as it keeps the base directory clean.  It just makes the administration slightly easier as I know everything under there is Magento.  It also means that if I need to install other applications (unlikely but I’m not a fortune teller), I can.

It’s fairly trivial to use the ReWrite options to make the URLs pretty.  I’ve recorded a screencast showing how to do this but it needs editing and encoding so I’ll publish it later this week.  Here’s the procedure to go along with the screencast.  Let me know if you have any issues.  I used the procedure on Magento 1.3 and updated it slightly for 1.4.  It seems to work fine on my test dev environment so feedback would be appreciated if you use it. 

The URLs will make more sense when you see the screencast.  Note: http://scwcomputersystems.com is a fake domain I made up for the purposes of my screencast. 

Before you do anything remember to make a backup of your database & directories so if things do go wrong you can quickly and easily backout the changes. 

---

For this demonstration I will assume the following.  You’ll need to change the directories and domain name to suit your own installation.

Assumptions

a. /public_html/ is your root web directory
b. /public_html/scw_magento/ is where you installed Magento
c. scwcomputersystems.com is your domain name
d. You want your home page for your store to be http://scwcomputersystems.com/ rather than http://scwcomputersystems.com/scw_magento/

Steps

1. Install Magento to /public_html/scw_magento/ normally. (Do not change Base URL during installation.)

2. Copy /public_html/scw_magento/.htaccess to /public_html/.htaccess

3. Edit /public_html/.htaccess. Uncomment and change the “RewriteBase” entry to point at your Magento installation directory.  ie:

- From -

############################################
## you can put here your magento root folder
## path relative to web root

    #RewriteBase /magento/

- To -

############################################
## you can put here your magento root folder
## path relative to web root

    RewriteBase /scw_magento/

4. Copy /public_html/scw_magento/index.php to /public_html/index.php

5. Edit /public_html/index.php and prefix the paths with your Magento Installation directory.  ie: Change the following lines from:

...
$compilerConfig 'includes/config.php';
...
$mageFilename 'app/Mage.php';
...
    include_once 
dirname(__FILE__) . '/errors/503.php';
...

- To -

...
$compilerConfig 'scw_magento/includes/config.php';
...
$mageFilename 'scw_magento/app/Mage.php';
...
    include_once 
dirname(__FILE__) . 'scw_magento/errors/503.php';
...

6. Login to your Admin Backend.  Choose the “Current Configuration Scope” in the top left appropriately.  If you are only running one website and one store front from your Magento installation then you can leave the scope set to “Default Config”.  If however you are running multiple websites you need to select the website from the list.  If you are in any doubt leave the scope set to “Default Config”.

7. Go to System -> Configuration -> Web

8. Under “Unsecure” update the URLs:

Base URL: http://scwcomputersystems.com/
Base Link URL: http://scwcomputersystems.com/
Base Skin URL: http://scwcomputersystems.com/scw_magento/skin
Base Media URL: http://scwcomputersystems.com/scw_magento/media
Base Javascript URL: http://scwcomputersystems.com/scw_magento/js

9. Under “Secure” change:

Magento Commerce - Admin - Secure URL Configuration

Base Secure URL: http://scwcomputersystems.com/
Base Secure Link URL: http://scwcomputersystems.com/
Base Secure Skin URL: http://scwcomputersystems.com/scw_magento/skin
Base Secure Media URL: http://scwcomputersystems.com/scw_magento/media
Base Secure Javascript URL: http://scwcomputersystems.com/scw_magento/js

Note: If you enable SSL then you need to replace the “Secure” URLs with “https” not “http”.

10. Clear the cache (Using SSH, FTP, or a Browser File Manager, delete everything under ../scw_magento/var/cache/* and ../scw_magento/var/session/*).  Clear your browsers cache and cookies.

11. Now navigate to your base URL - http://scwcomputersystems.com/ and all being well you should see the store front.  Your Admin URL will now be http://scwcomputersystems.com/scwadmin (or whatever you changed the Admin URL to).

HTH

 
Magento Community Magento Community
Magento Community
Magento Community
 
d3z1gnr
Jr. Member
 
Total Posts:  10
Joined:  2009-11-14
 

hey thanks for that! that’s really interesting and i do see your point about keeping it all in one clean dir.

i will give it a go later today (have not made any big updates yet) and let you know how it all goes!

mike

 
Magento Community Magento Community
Magento Community
Magento Community
 
patrace
Jr. Member
 
Total Posts:  7
Joined:  2010-02-09
 

That works great for me, much better than shuffling a bunch of files around and cleaner than having everything in the root directory.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
patrace
Jr. Member
 
Total Posts:  7
Joined:  2010-02-09
 

Hmm… actually.. scratch that.  It only half works.  I seem to be having a problem with CSS and Js files.

for now I\’m just dropping this into my .htaccess in the main directory

RewriteEngine On
RewriteBase 
/
RewriteCond %{REQUEST_URI} !^/store(.*)
RewriteRule (.*) /store/$1 [L]
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top