问题
I am using Magento on a GoDaddy's shared hosting account, I have just configured it and able to see the home page, but not the other pages, What could be the issue? Anything in .htaccess
?
Current hosting path is
/home/content/42/9469242/html
回答1:
From the Magento wiki :
A common error, which usually comes up if you’re hosted by GoDaddy, is the no input file specified error.
If you do not have Magento setup in the root of your server, make sure to add the following to your .htaccess file.
RewriteBase /yourbasepath/
Once that is verified, there are a couple things you can do to fix this, but we’ll start with the one that usually works.
In your web root directory, there should be a file called php.ini. Rename this to php5.ini.
If there is no php5.ini file. Create the file and upload it to your root directory.
If that doesn’t work, add the following to the end of your newly renamed php5.ini file:
cgi.fix_pathinfo = 1
And if you’re still getting the error, add the following to the top of your .htaccess file:
Options -MultiViews
The first one usually does the trick. If you don’t see this file in there, then create a blank php5.ini file add add the line listed on the second suggestion.
If all of the above has not worked, KEEP your changes, wait exactly 24 hours. Go back to youraddress.tld/downloader and try again. You may just be cached and for some reason it takes a bit longer then I was used to. Keep your chin up!
If nothing above worked, call GoDaddy up and have them either rename this for you, or make sure you’re on PHP 5.
BTW this is first result that comes up on Google for "magento no input file specified".
回答2:
If you need PHP 5.3, GoDaddy only offers it with FastCGI (as of now) which is what causes this issue (no input file specified). To solve it and keep PHP 5.3 functionality, put the following three lines on the top of your .htaccess
file:
addhandler x-httpd-php-cgi .php4
addhandler x-httpd-php5-cgi .php
addhandler x-httpd-php5-cgi .php5
This basically handles PHP-CGI to PHP only (disabling FastCGI).
回答3:
Please add this line of code to bottom of mod_rewrite section in .htaccess in your root directory .
RewriteRule ^index.php/(.*)$ [L]
This solved my issue with godaddy server.
回答4:
It's a common problem with godaddy hosting account. Try doing this
- Go to your godaddy account and launch hosting panel
- Go to hosting menu -> More -> File Extension Management
- Edit .php5 and .php extensions to run under php 5.2x
It should resolve the problem.
来源:https://stackoverflow.com/questions/11152425/cannot-access-homepage-of-magento-hosted-on-godaddy