Jump to content

500 Internal Server Error on Front End and BackEnd


Recommended Posts

I am getting an internal server error on both front end and back end.

When I checked error log, I got this error
[Mon Dec 29 12:19:17 2014] [alert] [client 157.55.39.140] /home/almuradc/.htaccess: </IfModule> without matching <IfModule> section

It says </ifmodule> there but no such thing there.

Prestashop version that I have on my website is 1.3.7.0.

The htacess file code is as follows :- 
 

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
 
# URL rewriting module activation
RewriteEngine on
 
# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [QSA,L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [QSA,L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html/(.*)$ /product.php?id_product=$2&id_product_attribute=$4 [QSA,L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html/(.*)$ /product.php?id_product=$1&id_product_attribute=$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang=$1$5 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang=$1$4 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [QSA,L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)$  /category.php?id_category=$1&id_product=$3 [QSA,L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9_-]+)$ /$1.php
 
# Catch 404 errors
ErrorDocument 404 /404.php
RewriteCond %{HTTP_HOST} ^al-murad.co.uk
RewriteRule (.*) http://www.al-murad.co.uk/$1 [R=301,L]
 
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ / [R=301,L]
 
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
 
RewriteRule ^home/index.php  / [R=301,L,NC]
 
 
 
Can anyone please help how to remove this error ?
Edited by vaibhavj (see edit history)
Link to comment
Share on other sites

Is your Prestashop really installed in "/home/almuradc/" ? There's no public HTML or whatever else? You might not be looking to the right .htaccess...

 

If your PS is in "/home/almuradc/public_html/", and you are opening "/home/almuradc/public_html/.htaccess", check a level above... J

 

Martin

Link to comment
Share on other sites

Yes you right

Its looking at wrong htacess file due to wrong file path

My website files are in /home/almuradc/public_html/

and the htaccess file path is 
/home/almuradc/public_html/.htaccess

Can you please tell from where I change this wrong path ?

 

Link to comment
Share on other sites

In an Apache Server (Please someone correct me if I'm wrong), the server will look at the acestor .htaccess before. Your problem:

 

The root htaccess ("/home/almuradc/.htaccess") is being called. I don't know where that .htaccess comes from, if you didn't create it someone or something did it. This htaccess is the problem, it doesn't come from the Prestashop. Your problem, whatever is the source of it, should be corrected by the one who created the htaccess. It might be your host provider or your developer (If you got one).

 

Can't help you much beyond that point.

 

May the force be with you. J

 

Martin

  • Like 1
Link to comment
Share on other sites

Thanks Martin for your help 

It cleared a lot of things and helped me in sorting it

You were right, in an Apache Server , the server will look at the ancestor .htaccess files.

There were about 4-5 htaccess files in the home/almuradc .
I deleted all this htaccess files and the site is working now


But still I am surprised that 2-3 hours back the site was working correctly, then suddenly it stopped working and started showing this error
No one changed the code 
But still don't know how this extra 4-5 htaccess files were generated auto

Thanks again Martin

 

Link to comment
Share on other sites

Been a pleasure.

 

You better look out for the ".htaccess" proliferation. It might only be because your hosting provider made a mistake...But it also could be a security flaw on your server.

 

Some hacking technic involve uploading ".htaccess" (or *.php) on the targeted website. You might be under (or has been under) attack, look carefully for this issue with your Hosting provider, and keep a .htaccess if it happens again (rename it), just to show it to your hosting provider. I don't want to alarm you, but keep an eye open for some ".htaccess" spawning.

 

Martin

Link to comment
Share on other sites

×
×
  • Create New...