Jump to content

.htaccess overwitten by friendly url has killed my links....


Recommended Posts

Hi All,

I created a blank .htaccess and uploaded it to a site http://www.perfectpaysupply.com/ and generated a htaccess file using the generator after turning on friendly in preferences.

This caused a problem where the images were not changing and although the pages were changing when clicking links - so i thought I would turn off friendly url's until i solved the problem - but now I am getting errors when I click any products 404 errors to be precise - please advise urgently.

Link to comment
Share on other sites

Hi All,

I created a blank .htaccess and uploaded it to a site http://www.perfectpaysupply.com/ and generated a htaccess file using the generator after turning on friendly in preferences.

This caused a problem where the images were not changing and although the pages were changing when clicking links - so i thought I would turn off friendly url's until i solved the problem - but now I am getting errors when I click any products 404 errors to be precise - please advise urgently.

Hello
Please regenerate the immage
Link to comment
Share on other sites

This must be a htaccess problem. It has screwed up the layout and some links dont work.

This is the htaccess I have:-

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# 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 [L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [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 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [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 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [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]

# Catch 404 errors
ErrorDocument 404 /404.php



Please help guys - the shop is not usable and I have an upset client.

Link to comment
Share on other sites

OK when i loaded it via IE8 ( I probably need to clear the cache in ff)the screwy look disappear - but with URL friendly off - i get 404 errors, with friendly url on the link work but no thumbnails. If I check the file property - it shows the correct link and the files is there.

Link to comment
Share on other sites

Thanks for the response Lunken - thats what I did - and to be sure I did it again just now - and it is still showing the "?" placeholders for the images. I also regenerated thumbnails - and it still does not work.

Just to be sure here is the htaccess file as created a few moments ago:-

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# 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 [L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [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 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [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 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [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]

# Catch 404 errors
ErrorDocument 404 /404.php




Also - I just noticed that some links still give me 404 errors. Top Brands for example show images - but when I click it gives me a 404 the URL is showing as http://perfectpaysupply.com/oatey

Link to comment
Share on other sites

Top Brands for example show images - but when I click it gives me a 404 the URL is showing as http://perfectpaysupply.com/oatey


That url is incorrectly formatted for prestashop, as there is no manufacturer id included in the url. http://perfectpaysupply.com/25_oatey is the correct url. I presume the urls TopBrands box are hardcoded by yourself. Same goes for all the links in that box. Looks like the shop by brand page has the same problem.

This page has the correct url's for all the manufacturers http://perfectpaysupply.com/manufacturer.php
Link to comment
Share on other sites

I agree with top brands I need to do some further digging - but for some reason the category images are going to default - and not the correct location for the image being uploaded. The products seems fine - its the category images which have suddenly defaulted to the default images.

Where do I go from here? As it stands the friendly url cannot be turned off as it gives 404 errors, and if it is on it cause the catergory images to go to default. The correct images and the deafult images are in the same directory - it just not pointing at the right place.

Just to clarify - this is the image located at http://perfectpaysupply.com/img/c/99-subcat_thumb.jpg

but on the front office it shows this

http://perfectpaysupply.com/img/c/en-default-subcat_thumb.jpg

Link to comment
Share on other sites

OK - John kindly took a look at the setup and could not work it out either.

We both agree that there was probably a .htaccess file in place - which I overwrote (I know back up ) with the generator after triggering friendly url. If i turn it off - i get 404 errors, so I stuck either way. So any htaccess experts out there able to shed some light?

I have asked the host for a copy of the htaccess file prior to the change - assuming they back it up.

SOOOO....

Link to comment
Share on other sites

John has also suggested that the previous htaccess was a customised htaccess file was being used to remove the id numbers from the urls, which is why a lot of links and images don’t work.

I guess if I could work out the string used - I could replicate this on the new htaccess - so anyone have an idea?

Link to comment
Share on other sites

OK - I have done some diggin (getting desperate). I am thinking that the original htaccess was using something like this link suggests

http://www.openscriptsolution.com/2010/05/04/how-to-remove-product-id-from-url-of-prestashop-version-1-2-5/

If I could work out how to apply this to the category images, and the Top Brands - I would be half way back I think. Am I barking up the wrong tree?

Link to comment
Share on other sites

No one know what can be done?

I am guessing if I can get the "id's" put back in the url for categories and top brands it would work - but how? I assume that with the category id missing is causing the images to display the default image.

Please any help would be very useful right now.

Link to comment
Share on other sites

OK still needing help - but trying as much as I can find out bits and pieces which may trigger something someone reading this may spot.

I have another file called .hgignore which is next the same place as the .htaccess

It has the following code within it - could this be why I cant see any category pictures?

relre:^\.idea\/.+$
relre:^admin-pps\/import\/.+$
relre:^img\/c\/.+\.jpg$
relre:^img\/p\/.+\.jpg$
relre:^img\/m\/.+\.jpg$
relre:^img\/s\/.+\.jpg$
relre:^img\/scenes\/.*\.jpg$
relre:^img\/scenes\/thumbs\/\*\.jpg$
relre:^img\/su\/.+\.jpg$
relre:^img\/tmp\/.+$
relre:^tools\/smarty\/compile\/.+$
relre:^tools\/smarty\/cache\/.+$
relre:^wp_blog\/wp-content\/uploads\/.+$
relre:^pdf\/.+$
relre:^download\/.+$
relre:^do_update$
relre:^sitemap.xml$


A shot in the dark - any advice.
Link to comment
Share on other sites

Yeah - valid point John. I'm clutching at straws tbh. It only seems to affect the category and subcategory images.

If I could just figure that out I could look at the other issue - this seems so simple, but clearly not. All the images are in the correct folder, they upload correctly - but just wont display - very odd.

Link to comment
Share on other sites

OK progress. I have managed to get my hands on the orginal htaccess file - and it seems like an awful lot of re-writing going on. It appears to have the friendly url re-write added at the bottom. When I turn on friendly URL it kills the pciture on the categories still - but at least now I can turn it off.

Any suggestions on how I make this work with friendly URL.

I have attached the htacces file as it is quite large.

htaccess.txt

Link to comment
Share on other sites

  • 1 month later...

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...