分享

写回答

发帖

[提问] GD URL 重写求助

GoDaddy GoDaddy 4279 人阅读 | 10 人回复

发表于 2010-12-1 08:55:30 | 显示全部楼层 |阅读模式

我用的是prestashop,想开个网店,可是那个.htaccess好像跟godaddy不兼容,我换过linux现在又换回windows,都不行,有没有人能帮我解决下?
我是很纯粹的菜鸟,代码是看不懂的,只知道大概的意思。。。刚才看了几个高手的帖子,实在感到无能为力。。。
有没有人能帮帮忙啊?

回答|共 10 个

add.c

发表于 2010-12-1 09:08:15 | 显示全部楼层

把你的htaccess 以及你如何设置的发出来看看

eileen198371

发表于 2010-12-1 09:17:48 | 显示全部楼层

我的htaccess文件:

# URL rewriting module activation
RewriteEngine on
RewriteCond %{REQUEST_METHOD} !^(TRACE|TRACK|GET|POST|HEAD)$
RewriteRule .* - [F]
RewriteBase /
Options +FollowSymLinks

# 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]

# Catch 404 errors
ErrorDocument 404 /404.php

其他的设置我都是按照系统安装的要求做的。。。。

add.c

发表于 2010-12-1 09:21:00 | 显示全部楼层

注意.htaccess前面的.不要忘记了。
RewriteBase /        这行改为 RewriteBase /mulu
/mulu为你网站所在目录

eileen198371

发表于 2010-12-1 09:22:34 | 显示全部楼层

嗯,我加了点的。
还有哦,我的目录是根目录,需要再写吗?

add.c

发表于 2010-12-1 09:25:06 | 显示全部楼层

回复 5# 的帖子

没问题。
不过现在你用的是linux主机吧, windows主机这个不能生效的
RAKSmart

eileen198371

发表于 2010-12-1 09:30:11 | 显示全部楼层

问题是linux下,也是有问题的。我看了很多帖子,很多人说godaddy的问题。我不知道别人是怎么弄成功的。
昨天问了客服,回答也是风马牛不相及,只是叫我改主机。。。。

看到了有人成功设置了,可是我自己的还是不行,折腾了好几天,一点结果都么有。。。。以下是我看到的。。。



I’m hosting my site with HostGator and noticed that the .htaccess generator wasn’t working. I searched the forums but couldn’t find an answer so i searched around the internet and found the info below. So i gave it a shot and it seems to be working perfectly. BTW the server i am on runs CentOS Linux.

I found the below article here:
http://prestashop-godaddy.blogspot.com/2009/02/how-to-get-prestashop-friendly-url-url.html

Its been a long and frustrating time for all those who have had a terrible time trying to figure out and get help with the errors occuring after enabling Friendly URL’s in PrestaShop. I myself had the same problem for about 1 whole month before finding the answer.

I have taken the time to find out exactly what lines of code to add to the .htaccess file that will work for all webmasters working with a basic install. I was raging so much over this, and I’m sure many of you PrestaShop webmaster’s were as well.

I must share this with you because I cannot bear to think of the anxiety that many of you have and are going through. So pay attention. This is very simple!

Put aside all methods everyone else has told you. This is for a standard installation using the Linux hosting packages. I personally use the deluxe hosting and my PrestaShop root is not in the main root of my hosting account, nor is the domain to that root tied to my account. So it doesn’t matter where it is. Just as long as your store is up and running and you are waiting to get this over with!

Make your “.HTACCESS” look exactly like this:

# URL rewriting module activation
RewriteEngine on
RewriteCond %{REQUEST_METHOD} !^(TRACE|TRACK|GET|POST|HEAD)$
RewriteRule .* - [F]
RewriteBase /
Options +FollowSymLinks

# 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]

# Catch 404 errors
ErrorDocument 404 /404.php

Now… Yer not done just yet. Make sure you clear your browser’s cookies if you dont notice any change. Also go to the sitemap module and update it just to be safe.

The Results should take place as soon as your website says that your settings have been saved. Check your product pages and everything should be alright. With one exception. Some people can’t get the proper URL to show up under “Recently Viewed” viewed items. I’m pretty sure you can just add another line in the
ReWriteRule and it should work. But I don’t have a need for that so I didn’t bother researching.

eileen198371

发表于 2010-12-1 09:30:45 | 显示全部楼层

我都是按照这个人讲的做的。。。还是不行。。。累死我了。。。

add.c

发表于 2010-12-1 10:59:38 | 显示全部楼层

等会我测试一下吧,现在我的主机也有点问题

eileen198371

发表于 2010-12-1 12:46:34 | 显示全部楼层

我刚才加了点钱,升级了下主机。。。居然好了。。。
就是图片不太正常,还有就是不能使用translation....
继续头疼。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则