.htaccess和RewriteRule表达式

问题描述 投票:0回答:2

我有以下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

这该怎么做?

html apache .htaccess
2个回答
3
投票

不应该反过来吗?

RewriteRule ^wine/([0-9]+) /jcb-wine$1.html

0
投票

删除^ rr写完全uri喜欢

RewriteRule ^/jcb-wine([0-9]+)/?$ /wines/$1
© www.soinside.com 2019 - 2024. All rights reserved.