cancel
Showing results for 
Search instead for 
Did you mean: 

Update to 1.9 is changing the htaccess

Update to 1.9 is changing the htaccess

Hi,

 

When update/upgrading magento trough the downloader in the backend it is replacing the htaccess with a new one.

How can we disable this option. It gives an error 500 because of the htaccess changes by upgrading to 1.9.x

 

Best regards,

Ocean

6 REPLIES 6

Re: Update to 1.9 is changing the htaccess

You don't, .htaccess is one of the core upgrade files in a Magento upgrade.

 

What you do is save the original copy, use diff to compare it to the new copy to your save copy, update any changes into your save copy and then replace .htaccess with it.

 

Re: Update to 1.9 is changing the htaccess

Chiefair, thanks for your reply. The webserver is giving an error 500 because of the following line in the core htaccess

 

RewriteRule .* - [L,R=405]

 

What results in a uncompleded updated magento

 

Re: Update to 1.9 is changing the htaccess

While upgrading to Magento you need to keep backup of the old .htaccess and replace it to the new one after upgradation.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

Re: Update to 1.9 is changing the htaccess

But the update is being stopt because of the error500. Even when I delete htaccess, the update script is adding a new htaccess.

Re: Update to 1.9 is changing the htaccess

Your breakage is on the entry:

 

RewriteRule .* - [L,R=405]

 

The 1.9 version (they finally got around to recognizing this issue) that's breaking your install which issues a 405 Method not Allowed:

 

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]

 My version that's been in since 1.4.1.1, not sure why it's necessary to do a 405 Method not Allowed, I just give them the 403 Access Denied finger.

 

###############################
# Kill TRACE and TRACK for Cross Site

    RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK) [NC]
    RewriteRule ^(.*)$ - [F,L]

 

Not all apache installations are set up to do the reply number thing (R=405) and it is quite often a nasty source of web server 500 errors. (Apache2 should fully support it)

 

Here's how I upgrade Magento to a new version. First of all, the Connect way of doing it is crap, whether you use the web interface or do the command line mage thing.

 

I go to the Magento downloads page and get the version I'm upgrading to (zip for Windows, gz for Linux). Personally, my staging/dev is Linux as that is what the live system runs. Lots less headache this way.

 

I decompress it in its own directory and then make some modifications, one of them being the .htaccess file as it is highly specific to my website (directories, memory, max input variables, max execution time, exclusions, rewrites).

 

I compare the Magento .htaccess version against my version to see if there are needed items, also rename the cron files so they won't automatically function (same on the server when we get to the upgrade, nothing bolloxes up a database upgrade as much as having cron fire off and try to do its own thing).

 

I also change the magento folder to public_html as this is where it will live on my installation.

 

After this, I archive the install back up, transfer it to the staging server in my home folder, the directory above the Magento root folder (public_html), dearchive and let it do the install. From there on out, cross fingers and pray that it will minimally function (not live so we don't lose revenue) so I can start hacking out the contorted, spine filled path into the castle to eventually kiss the princess and hope she's not ugly.

Re: Update to 1.9 is changing the htaccess

Hi, I have a problem that affects just these 500 errors, but also 503 and 404 after updating many magento from version 1.7 to 1.9.x The update was done using magento 1.9 last verisone installed on the old magento database.

After a few days Google serach console pointed me many errors 500, which is opened by clicking on the link indicated by search console, they open the page of the site with 404 error.

This made me lose in two weeks many important links in google SERP.

In the .htaccess file, I risocntrato this variation you have indicated on the rewrite rules:

RewriteRule. * - [L, R = 405]

I do not know what this code means, but if it is the cause of all mistakes, I want to know how to solve.

Please, I need some advice about.

 

Thanks