开发者

.htaccess and RewriteRule expression

开发者 https://www.devze.com 2023-04-06 07:55 出处:网络
I have following urls domain/jcb-wine{number}.html and i need to rewrite them like domain/wines/{number}

I have following urls domain/jcb-wine{number}.html and i need to rewrite them like domain/wines/{number} I do something like this

RewriteRule ^jcb-wine([0-9][0-开发者_如何学编程9])$ /wines/$

But this has no effect :(

my .htaccess

ErrorDocument 404 /404.shtml
Options +FollowSymLinks

RewriteEngine On
RewriteBase /
RewriteRule ^wine/([0-9]{2}) /jcb-wine$1.html

How to do this?


Shouldn't it be the other way round?

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


remove ^ оr write full uri like

RewriteRule ^/jcb-wine([0-9]+)/?$ /wines/$1
0

精彩评论

暂无评论...
验证码 换一张
取 消