Jump to content

[Help] Cài Friendly URL xong không hiển thị hình sản phẩm


Himoney

Recommended Posts

  • 2 months later...

sao em cài như trên rùi mà nó không tạo ra file htaccess.txt hay .htaccess. mình tạo 1 file .htaccess thi nó General ra nội dung

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

# Catch 404 errors
ErrorDocument 404 /prestashop/404.php


click vào sản phẩm thì nó báo là không tìm thấy. Xin được trợ giúp

Mình có thấy 1 đoạn code trong 1 rum sau

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

# Catch 404 errors
ErrorDocument 404 /404.php

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$3 [L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ supplier.php?id_supplier=$1$3 [L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ manufacturer.php?id_manufacturer=$1$3 [L,E]


nó cũng hiển thị hình ở ngoài trang chủ, nhưng click vào sản phẩm thì nó cũng báo là không tìm thấy, mình đang sử dụng prestashop_1.2.5.0. Xin cảm ơn
Link to comment
Share on other sites

  • 3 weeks later...
sao em cài như trên rùi mà nó không tạo ra file htaccess.txt hay .htaccess. mình tạo 1 file .htaccess thi nó General ra nội dung

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

# Catch 404 errors
ErrorDocument 404 /prestashop/404.php


click vào sản phẩm thì nó báo là không tìm thấy. Xin được trợ giúp

Mình có thấy 1 đoạn code trong 1 rum sau

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

# Catch 404 errors
ErrorDocument 404 /404.php

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$3 [L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ supplier.php?id_supplier=$1$3 [L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ manufacturer.php?id_manufacturer=$1$3 [L,E]


nó cũng hiển thị hình ở ngoài trang chủ, nhưng click vào sản phẩm thì nó cũng báo là không tìm thấy, mình đang sử dụng prestashop_1.2.5.0. Xin cảm ơn


Trước hết bạn cần mở tính năng Friendly URL trong thẻ Preferences (trong phần quản trị admin), tiếp đó tạo 1 file .htacess với nội dung như sau: (Đây là nội dung file .htacess mà mình đang sử dụng bạn có thể thay đổi cho phù hợp với site của bạn)

#.htaccess automaticaly generated by PrestaShop e-commerce open-source solution

#http://www.prestashop.com – http://www.prestashop.com/forums

#URL rewriting rules
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.savitel.vn$ [NC]
RewriteRule ^(.*)$ http://savitel.vn/$1 [R=301,L]

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 ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.png$ /currency.png [L,E]
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.gif$ /modules/blockcategories/right.gif [L,E]
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.png$ /language.png [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]
RewriteRule ^getflash/?$ http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash [NC,L,R=307]

Options All -Indexes
#Catch 404 errors
ErrorDocument 404 /404.php



Chúc bạn thành công!

21696_Ifz8UobUCo7mxaTk2nb6_t

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