Mod rewrite 重定向不适用于匹配我的url中的模式

Mod rewrite 重定向不适用于匹配我的url中的模式,mod-rewrite,Mod Rewrite,我正在尝试重定向URL的模式 http://style.com/style-blog/entry/what-im-looking-for-in-my-next-15-inch-laptop 到 我试着匹配这里的“风格博客” 我需要更新第一个版本,以便将url的任何剩余部分附加到此处的新url RewriteRule ^style-blog/([A-Za-z0-9-]+)$ http://style.com/you-blog/$1 [NC,L] 谢谢你指点我做错了什

我正在尝试重定向URL的模式

http://style.com/style-blog/entry/what-im-looking-for-in-my-next-15-inch-laptop

我试着匹配这里的“风格博客”

我需要更新第一个版本,以便将url的任何剩余部分附加到此处的新url

  RewriteRule    ^style-blog/([A-Za-z0-9-]+)$    http://style.com/you-blog/$1    [NC,L]   

谢谢你指点我做错了什么。

我想你可能只是错过了一个
/

RewriteRule  ^/style-(blog/[A-Za-z0-9-]+)$  http://style-review.com/$2
使用通配符:

RewriteRule  ^/style-(blog/.*)$  http://style-review.com/$2
你需要完整的URL吗

RewriteRule  ^/style-(blog/.*)$  /$2
需要
^
$
吗?这不管用吗

RewriteRule   style-blog/   blog/

这似乎是可行的,但多亏了你们,你们让我走上了正确的轨道,也许你们没有足够的信息来解决这个问题。它还没有完全测试过,可能无法处理任何额外的“文件夹”(斜杠之间的位)

wow-我不知道它们会这么简单!我现在正在做一些实验-还不确定它是否是正确的解决方案-Thankshmm似乎没有任何匹配-例如,我甚至无法重定向到主页匹配,如下所示:RewriteRule^ style blog$[NC,L]@landed我想应该是
RewriteRule^/style blog$…
或者
^/style blog/$…
。没有任何东西被识别-htaccess正在进行重定向,从而从我的URL中删除www-所以它不是这样。我还试过重写Rule laptop,但也不起作用,^laptop$…哪些字符串是固定的,哪些是动态的?请给出一个典型的传入URL和一个替换URL的示例,因为问题中的最后一个URL与重写规则无关。那么,示例中的规则或URL是什么?
RewriteRule  ^/style-(blog/.*)$  /$2
RewriteRule   style-blog/   blog/
RewriteRule ^style-blog/(.*)/(.*)$ http://%{HTTP_HOST}/you-blog/$1/$2 [R=301,L]