Reputation: 109
I know there are a lot of questions similar to this asked in the past, but I have looked through all of them and none of them are the same as this.
I have a been developing a Magento site on MAMP. I made several backups of the files and database. I moved the site to my live server, everything worked. I have now moved the site back to MAMP for more development. The Home Page works but the rest of the site gives a 'Not Found. The requested URL was not found on this server' error.
I tested to see if the database worked with one of my backups files (which had been saved before moving to the live server), and it did, which suggests that the problem is with the files I have moved over from my live server.
I read numerous people mention editing the .htaccess file, so I decided to have a look. What I found is that the .htaccess file for the files that DO work open in the terminal window. And the .htaccess file for the files I moved from my live server and DON"T work open in a text editor file. There is also only one line of code in this file which is: #AddHandler application/x-httpd-php54 .php
I do not know what this line of code means, however I have an idea of what might of happened. After I moved my site to my live server, I asked my hosts to update my PHP. (This was a silly thing to do as I have no knowledge of how PHP works, however I did it because I received a message in my Magento backend telling me that the new PHP was available, I thought I needed to update it to keep my site secure. I am very much a rookie still). My hosts updated it and my Live site stopped working. I asked them to change it back to the original PHP I had and they did. There was still a problem. They did not know how to fix the problem at first but then informed me that they had fixed it by following the solution in this link Request exceeded the limit of 10 internal redirects due to probable configuration error , which involves adding a .htaccess file to the root directory of my live server (/home/caprac5/public_html/.htaccess) and adding the following code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
To me it seems like my hosts have added this .htaccess file to the root directory of my live server which allowed my site to work, however now that I have moved my website back to MAMP it no longer has this .htaccess file to make it work. I do not know if I should try adding this .htaccess file to the root directory of MAMP, or if anyone knows how to possibly fix the .htaccess file that is in the actual website folder.
I hope people are able to follow what I am saying. If not please just leave a comment and I will try to explain better.
Thanks
Upvotes: 2
Views: 9572
Reputation: 2436
First of all, are your local files in an Application/MAMP/htdocs subdirectory ? It is required for the local server to find the files.
Some explanation about the .htaccess :
The line you have in your .htaccess is commented (starts with a #)
The code your hosts added simply enables the use of .htaccess files.
The commands tells your server to use application/x-httpd-php54
program to interpret /php
files. 5.4 is the last version of php and I assume there are several php interpreters on your remote server which is why you need to precise it.
If your files are in the correct directory, look for a httpd-php file on your computer and add AddHandler application/x-httpd-phpXX to your .htaccess where XX are the numbers for your local httpd-php (it is possible that there are no numbers)
Upvotes: 2