我有以下urls domain / jcb-wine {number} .html,我需要像domain / wines / {number}一样重写它们 我做这样的事情
RewriteRule ^jcb-wine([0-9][0-9])$ /wines/$
但这没有效果:(
我的.htaccess
ErrorDocument 404 /404.shtml
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^wine/([0-9]{2}) /jcb-wine$1.html
怎么做?
答案 0 :(得分:3)
不应该反过来吗?
RewriteRule ^wine/([0-9]+) /jcb-wine$1.html
答案 1 :(得分:0)
删除^或写完全uri像
RewriteRule ^/jcb-wine([0-9]+)/?$ /wines/$1