Prestashop backoffice works but the frontoffice doesn't. The url is not found
Asked Answered
C

3

12

I have developed a multilanguage prestashop store completely in localhost using xampp in mac and it works. Both the backoffice and the store (frontoffice). After that, i have deployed it to amazon but there comes my problem. The backoffice works but the store doesn't.

The browser just displays an apache 404 page and tells me The requested URL domain/prestashop/en/ was not found on this server. But it does exist. Besides, the backoffice confirms it.

Inspecting the error.log I find the following message:

[Thu Mar 12 11:12:37 2015] [error] [client xxx.xxx.xxx.xxx] File does not exist: /var/www/prestashop/en

For what I see, Apache is treating the language (/en/) as file when it is not. I've searched all across the web and I can't find how to fix it. I know it is a server issue, but somehow can't find the solution.

What's the matter here?

Ca answered 12/3, 2015 at 11:51 Comment(7)
You must define (add if not exists) the custom name of the url on the "SEO & URL" tab.Getupandgo
The url exists, it is the index.php but the only thing is that may be in English or Spanish.Ca
And what happens is you change the url manually to lang-en instead of en?Getupandgo
Doesn't find it eitherCa
but url/en/index.php does exist?Getupandgo
I'm on my way to fix it. The mod_rewrite extension is not working.Ca
then the url's aren't being re-written and that's why your getting the error. in your apache. you need to run this on the command line to check if mod rewrite is actually loaded > apachectl -t -D DUMP_MODULESInterleave
Z
3

I usually set my vhost in the following way

<Directory /var/www/prestashop/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>
Zincate answered 1/4, 2015 at 18:32 Comment(0)
V
0

Solution moved from @LeonardoLanchas's question post.

I fixed the issue doing the following steps:

  1. Deleted the root .htaccess.
  2. Cleared the smarty cache files under ./cache/smarty/compile
  3. Load the mod_rewrite module that was not installed: a2enmod rewrite
  4. Added the Allowoverride All directive to /etc/apache2/apache2.conf
<Directory /var/www/prestashop/>
        Options Indexes FollowSymLinks
        AllowOverride All
</Directory>
  1. Restarted apache2: service apache2 restart
Vivl answered 12/3, 2015 at 11:51 Comment(0)
S
0

In my scope, in this file /etc/apache2/apache2.conf

This was the default:

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

I changed it to:

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

And then restarted the apache2 service

Seism answered 4/3, 2023 at 4:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.