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

Cannot access backend page
 
CatapultPB
Jr. Member
 
Total Posts:  3
Joined:  2009-11-07
 

So I installed Magento 1.4.0.1 in a subdirectory and moved it to my root directory by changing the URLs in the admin panel and moved the files to my public_html folder via FTP (I don’t have SSH)

I can access the frontend but when I get a 404 error when I try to access the backend

Not Found

The requested URL /admin was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 
Magento Community Magento Community
Magento Community
Magento Community
 
CatapultPB
Jr. Member
 
Total Posts:  3
Joined:  2009-11-07
 

Hello? Anyone have the same problem?

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

I would recommend you keep Magento in it’s own directory and setup rewrite rules to make it look like you installed it in your root domain.  Next week I’ll be publishing a screencast/video tutorial on “How To Configure Magento To Use The Base URL After Installing In A Sub-Directory” .  For now though I’m giving you a sneak peek at my article. 

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/scw_magento/.htaccess. Uncomment and change the “RewriteBase” entry

- From -

[code lang="php"]
############################################
## you can put here your magento root folder
## path relative to web root

#RewriteBase /magento/

- To -

[code lang="php"]
############################################
## you can put here your magento root folder
## path relative to web root

RewriteBase /scw_magento/

3. Copy /public_html/scw_magento/.htaccess to /public_html/.htaccess

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

5. Edit /public_html/scw_magento/index.php and 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. Choose the appropriate “Current Configuration Scope” in the top left.  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. Log into Magento Admin. Go to System -> Configuration -> Web

8. Under “Unsecure” change:

Magento Commerce - Admin - Unsecure URL Configuration

Base URL: http://scwcomputersystems.com/scw_magento/
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/scw_magento/
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).

 
Magento Community Magento Community
Magento Community
Magento Community
 
CatapultPB
Jr. Member
 
Total Posts:  3
Joined:  2009-11-07
 

Woah, big post. Thanks smile I’ll try it sometime tonight and let you know how it went.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mvh
Jr. Member
 
Total Posts:  14
Joined:  2010-05-08
 

Hi bitflip,

I am looking for a tested instruction to simply redirect the visitor via the index in the root to magento installed in a subdirectory, as your article describes.

So I have followed your steps precisely and found a few things I did not understand and in the end had a non working webshop.

Here my findings, maybe you can check and reply? I am sure quite a few website builders want to use this method as it leaves the main site untouched and a smooth “go-live” is guaranteed.

Your step 2 copies the .htacces from the install directory to the root which I found in some other magento articles.
step 3 You then switch on the rewrite in the subdirectory (edit .htaccess)
step 3 ( must be step 4 I presume) copies the .htaccess file (now with rewrite on) again to the root , hence is it not easier to leave step 2 out?
step 4 ok, is also mentioned in the magento article
step 5 you tell the index file in the subdirectory to use the config.php in root/scw_magento/scw_magento/ ? This ment that I get the downloader if I access the site as it can not find the files.

this also meant I could not get to the backend anymore to change the URL’s . Luckily I had access to phpMyAdmin and changed the values in the core_config_data table Row 347 - 354 and Row 2 & 3 .  Do you not have to end every URL with a backslash?
Anyway none of it helped, I had to do a rollback.

I regularly write testscripts for my employer and a basic rule is to let someone else execute them before we even give them a status “draft” .
In case anything goes wrong, we also include a rollback instruction.

But maybe I am wrong and have interpreted your post wrong, either way let me know as I am quite happy testing it out for you and I suppose many others. It is a shame that magento has not a good up to date article describing the steps with some detailed explanation.

Let me know if I can be of any assistance.

gr M

ps I could not find your promised article, was it published? If so have you got a direct link?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top