Jump to content

friendly urls create random forbidden or question mark


ycarrasco

Recommended Posts

Helo there,

 

In a new installation of Prestashop 1.5.5 we are experiencing random forbidden access in / and or question mark Gifs. This is only happening when friendly urls are activated. All seems to work smoothly without SEO.

 

I have regenerated the .htaccess file without changes.

 

Any ideas or thoughts?

 

Apache 2.2.22 in a 12.04.1 LTS ubuntu server

PS 1.5.5

Plesk 11.0.9

 

yolanda

Link to comment
Share on other sites

  • 1 month later...

Well, that's the hard thing... it can be any link you click.

 

Categories, Products, etc.

 

Sometimes, only a question mark appears.

Refreshing the browser does load the correct page then.

 

I've just re-enabled friendly URLs at my shop, as it's nighttime in Germany right now so I won't have that many visitors.

 

Just go to the site and click yourself through a few links, it will happen eventually.

 

http://www.dragonbox.de/

 

I'll disable friendly URLs again in about 30 minutes, but in case you want to look at it some other time, we can easily make an appointment.

Link to comment
Share on other sites

  • 4 weeks later...

EvilDragon try to change in blockviewed module, blockviewed.php file , line 110 the query by the following:

 

$productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT MAX(image_shop.id_image) id_image, p.id_product, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite
FROM '._DB_PREFIX_.'product p
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').')
LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = image_shop.id_image)
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').')
WHERE p.id_product IN ('.$productIds.')
AND pl.id_lang = '.(int)($params['cookie']->id_lang).'
AND cl.id_lang = '.(int)($params['cookie']->id_lang).'
GROUP BY product_shop.id_product'
);
 
 
The difference is "AND i.cover = 1"
Link to comment
Share on other sites

Thanks to the help of doekia, the issue has been solved:

It seems SSL and mod_cache do not play well together.

 

Disabling mod_cache for the shop (you can do that in virtual host config) did solve the issue.

Hi,

can you please expand on how you fixed the issues pls, I'm having the same problem, still learning and finding my way around prestshop admin... step by step instructions would be greatly appreciated :)

 

thank you

cheers

Link to comment
Share on other sites

this is what ipage did for me to fix it...

 

"I have corrected the reported issue by regenerating the .htaccess file with default rewrite code for your Prestashop website. Now, the images are showing fine with friendly URL in the website at http://www.bunnybubsclothing.com.au/ without any issues. Please check if images are showing fine in your website, and let us know if you have any further issues"...

 

I have no idea "how" to do this..... hope that helps you.... my images now display properly when friendly urls are enabled

 

cheers

Link to comment
Share on other sites

  • 4 weeks later...
  • 7 months later...
  • 1 month later...
I also have this problem, I have multi-shop activated with 2 shops with different domains and the problem is in both stores.

I have my own VPS with Plesk and I tried a lot of solutions but nothing works.

In the same server I have other websites working with wordpress and don't have the problem, so the problem is in prestashop.

 

I'm using a tool to monitor the websites and compare their activity, it's uptimerobot.com and it's free, when a website crashes send me an email. You can see when the web crashes and what error code gives.

Sometimes the web crashes every 5 minutes, other times works continuosly for hours.

 

Any news about it?

Link to comment
Share on other sites

Maybe anyone have some kind of cache system enabled?

 

About 403 forbidden error I noticed that the error is more frequent when more people are watching the website, so maybe the problem is related about the cache system.

 

I have APC working on my server and I read that is a good thing clear the cache at least once a day. You can do this restarting apache or calling a little php script with cron jobs.

 

For now I configured my server to restart apache every 12 hours to prevent fragmented cache and refresh all the system.

 

At this moment my Prestashop installation is working fine in the both domains of the multi-shop, no 403 error.

 

 

The other problem "Random Question marks" I think is related to cache too. The most time this error appears when I click on a category link through the top menu of the shop. If I visit a category for first time, the question mark appears. If I reload the page it loads fine. When I click another category that is not so much visited, question mark appears also.

So I think my cache system (APC) have some problem with cached pages and (I don't know why) shows me the question mark image. Maybe corrupted cache or something related, I don't know.

 

I'll keep you informed.

Link to comment
Share on other sites

 

Maybe anyone have some kind of cache system enabled?
 
About 403 forbidden error I noticed that the error is more frequent when more people are watching the website, so maybe the problem is related about the cache system.
 
I have APC working on my server and I read that is a good thing clear the cache at least once a day. You can do this restarting apache or calling a little php script with cron jobs.
 
For now I configured my server to restart apache every 12 hours to prevent fragmented cache and refresh all the system.
 
At this moment my Prestashop installation is working fine in the both domains of the multi-shop, no 403 error.
 
 
The other problem "Random Question marks" I think is related to cache too. The most time this error appears when I click on a category link through the top menu of the shop. If I visit a category for first time, the question mark appears. If I reload the page it loads fine. When I click another category that is not so much visited, question mark appears also.
So I think my cache system (APC) have some problem with cached pages and (I don't know why) shows me the question mark image. Maybe corrupted cache or something related, I don't know.
 
I'll keep you informed.

 

Ok none of this things are the problem, after this the errors increase so I've tried other things:

 

I'm using Plesk 11.5 in Ubuntu 12.04 Server.

 

QUESTION MARKS:

In my apache /var/log/apache2/error_log I found that the server is looking for the files in /var/www/default/htdocs but the correct path is /var/www/domain.com/httpdocs/ so maybe this is the problem of the question marks.

 

SOLUTION??: Delete some domain alias in plesk, I have multiple domains as alias for the main domain and one of these is the domain for the second store (I have multishop working), then create it again, this action will regenerate the /var/www/system/domain.com/conf/last_httpd.conf file where is defined the domain document root and where the server should look for files, not in the default directory.

 

 

FORBIDDEN 403:

In /var/www/vhosts/domain.com/logs/error_log I can see the following error:

 

[Thu Nov 13 10:11:41 2014] [warn] [client 192.81.213.81] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Nov 13 10:11:41 2014] [error] [client 192.81.213.81] Premature end of script headers: index.php

SOLUTION??: Searching in internet I found this rule for apache configuration, in plesk you should go to your plesk panel and clic in "Web server configuration" under your domain. Then put the following code in Additional HTTP directives:

 

<IfModule mod_fcgid.c>
FcgidBusyTimeout 3600
</IfModule>

This increase the timeout for FastCGI and let Prestashop finish their php scripts to work. I think is possible to put it in your .htaccess file, but if you can put at server level is better.

 

 

Both solutions at this moment are working for me, but I want to test it more time. I'll keep you informed.

Link to comment
Share on other sites

  • 5 months later...

Okay, time for some more news, as I switched to PrestaShop v1.6 yesterday night - and the issue is still there!

 

Interestingly, it didn't happen on the test setup where I setup the shop during the last weeks.

 

The test setup was on the EXACT same virtualhost, so the server settings are the same.

The ONLY difference between the the test setup and the live setup was that SSL was disabled on the test setup.

 

Therefore, I can tell that those random question marks only appear when using SSL in combination with Friendly URLs.

SSL alone works, friendly URLs alone work as well.

 

Now, what happens when the issue happens?

 

Take a look at the sourcecode it creates a basically empty HTML file with the image:

   <img src="https://www.dragonbox.de/de/60-restposten" alt="https://www.dragonbox.de/de/60-restposten"></img>
For some reason, PrestaShop sometimes creates an empty page just containing an image where it tries to load the friendly URL as a picture!

 

(Sorry, I wanted to post the full HTML output, but the forum didn't let me, the code-field became empty all the time)

 

In my opinion this can't be something in the server config, but rather in the friendly URL generator inside PrestaShop.

 

Maybe that helps the PrestaShop team resolving the issue (I'll put that into the bugtracker as well).

 

Does anyone know which file it is in prestashop that handles the friendly URLs?

Or is it REALLY only the generated .htaccess-file that handles that?

Edited by EvilDragon (see edit history)
Link to comment
Share on other sites

  • 1 month later...
  • 10 months later...

Hello,

 

Did someone solved this really?

 

I have been having this issue for a couple of months now, and I am reaching a point where I am thinking seriously to dump Prestashop and my online store out of the window.

 

I have 2 Prestashop installations on the same server, on the same domain, and under different folders. I have the dreaded problem in one, and the other is a new default installation and it is okay, so I am not sure that the solution is as Sundbox suggests.

 

Many thanks in advance and kind regards from Spain,

Edited by pagliaso (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...

I'm having the same issue.  If I enable "Friendly URLs" my images do NOT show up on my website.  I was told to disable Friendly URLs and my images will work.  And they do but my URLs look terrible and are even worse for SEO.

 

I purchased an Addon (Pretty URLs) hoping to use it as a work around to this issue but the Addon won't work unless Friendly URLs is enabled.  No bueno.

 

Is there a solution?

 

Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...