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

Moving site to JustHost and getting 404 error
 
flavormed
Jr. Member
 
Total Posts:  25
Joined:  2010-07-13
 

Hello everyone,

Recently I moved my site (flavorofmed.com) to JustHost (both files and database) and updated the local.xml to reflect the new database credentials. I put it in public_html/fotm and added this to the public_html .htaccess so that just by typing in the website name it would act as if it was in that folder.

# .htaccess main domain to subdirectory redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change yourdomain.com to be your main domain.
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/fotm/
# Don't change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /fotm/$1
# Change yourdomain.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?flavorofmed.com$
RewriteRule ^(/)?$ fotm[L]

The problems I’m having are: all the pages other than the home page give a 404 error (the “whoops, our bad” one), if I rename local.xml to reinstall the site it gives me a “this site isn’t redirecting correctly” error (in Firefox) and the admin login page comes up but when I log in I’m redirected to a 404 error page ("whoops, our bad").

I’ve already tried clearing the cache and session folders. I’ve changed the one line in index.php to Mage::run (’default’); I’ve also changed almost all the folders and files to 755 and 644 respectively (except for media and skins they have 757 - I read that it works for JustHost).

Its been a few crazy days just trying to find the root of the problem and fix it. Is it a problem with redirecting? or is it the database’s url rewrites? I would greatly appreciate any help.
-Peter

 
Magento Community Magento Community
Magento Community
Magento Community
 
flavormed
Jr. Member
 
Total Posts:  25
Joined:  2010-07-13
 

I moved everything from the folder into the public_html folder and it works perfectly. But, I’d rather it be in a folder which would help me tons when I’m making back-ups of the files for upgrading and such. Is it possible to do such a thing? Does it have to do with the .htaccess or is it a DNS thing?
-Pete

 
Magento Community Magento Community
Magento Community
Magento Community
 
flavormed
Jr. Member
 
Total Posts:  25
Joined:  2010-07-13
 

I found my answer here after thinking it didn\’t exist in the forums. http://www.magentocommerce.com/boards/viewthread/10378/P30/#t289371. Total genius.

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