Jump to content

Friendly URL not working. Settings are right.


Recommended Posts

.htaccess -correct
mod rewrite rules -correct
http://www.avmpower.com/rewrite.php
(the fact that this test works shows that my htaccess is correct, but i've included it anyway)

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
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 ^([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 ^link([^/]*).html$ rewrite.php?link=$1 [L]

# Catch 404 errors
ErrorDocument 404 /404.php




php settings? -correct
allow_url_fopen local value = on, master value = on

Back Office > Preferences > Friendly URL = YES
http://www.avmpower.com/product.php?id_product=10 = works
http://www.avmpower.com/10-pivot-raizin-vs1.html = not working

what the flying duck?

i am not a coding expert, but i do know the basics, i've read the knowledge base, searched the forums, and thus I've tried all solutions that i can find. anybody have any clue?

Link to comment
Share on other sites

i met the same problem, i do know why, can anybody please help us ?

it can not creat HTML pages, when click the link , it shows "not find".......

hi friend,
i just visited your website , i found your html webpage is normal now,
how did you solved the problem ? will you please tell me ? thanks !~

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 5 weeks later...

Hey guys I had the same problem and found the solution today. The .htaccess file is slightly incorrect. This is the default that was given to us:

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
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 ^([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 ^link([^/]*).html$ rewrite.php?link=$1 [L]

# Catch 404 errors
ErrorDocument 404 /404.php




Now here is the correct version:

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^([a-zA-Z0-9-]*)/S=([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]

# Catch 404 errors
ErrorDocument 404 /404.php



Look at the 1st rewrite rule on the corrected version and u should see "S=". This is what is needed to make all of your links able to be URL Friendly when u choose that option in PrestaShop. I hope this works for u as it did for me. I went crazy for months trying to figure it out.
Link to comment
Share on other sites

Disregard my previous correction of the .htaccess file. Instead of adding "S=" in the 1st row, U should have your .htaccess file look like this:

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
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 ^(.*)/S=([^/]+)/(.*)    $1/$3 [E=STATUS:$2]

# Catch 404 errors
ErrorDocument 404 /404.php




Notice there is a new RewriteRule added at the end. This should work 100%. I will let u know if there is anything wrong.
Link to comment
Share on other sites

  • 3 months later...

My products worked fine with friendly urls, but the CMS pages did not. After replacing the .htaccess with the code from thiswholesale it's now working.

Thank you!

BTW: Is there a way to translet urls from my old shop to my new shop? Now customers get a 404 page when finding old links on search engines. It's about 80 products I need to redirect.

Old url: http://shop.pushvideo.no/scripts/prodview.asp?idProduct=150

New url: http://shop.pushvideo.no/66-tt-review-2008.html

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