1

参考这里的文章,我用以下几行创建了我的 .htaccess 文件

RewriteEngine on

RewriteRule ^/product/([0-9]+)/(.*)$ /index.php?route=product&product=$1 [L]

但这不起作用,我收到 404 错误。

我想要像这样的网址

http://localhost/product/12/some-random-text.html

被重定向到

http://localhost/index.php?route=product&product=12

我正在使用GoDaddy'sLinux 主机

4

1 回答 1

1

尝试将您的 RewriteRule 更改为:

RewriteRule ^product/([0-9]+)/(.*)$ /index.php?route=product&product=$1 [QSA,L]
于 2012-04-21T19:52:48.310 回答