可变301重定向URL(301 redirect URL with variable)

   IT问题网   2018-12-07 00:00:00

问 题

我想用htaccess的301重定向(不是重写)的网址,如:

brands.php?品牌=索尼

品牌/索尼

我怎样才能做到这一点?鸭preciate你的帮助提前。

解决方案

所以,你的用户正在进入 brands.php?品牌=索尼到他们的浏览器,重定向?如果我有正确的,这是简单的:

rewriteengine叙述上
的rewritecond%{query_string}品牌=([^&功放;] +)[nc]
重写规则品牌\ .php品牌/%1 [l,r = 301]
 

标签:可变定向



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

htaccess的重定向example.com/index.php到example.com/home~~V(htaccess redirect example.com/index.php to example.com/home)

problem thanks in advance, i am trying to redirect anyone ...

htaccess的重写规则问题(.htaccess Rewrite Rule Problems)

problem can anyone help me with htaccess rewr ...

htaccess的子域名与所有的变量文件参数(.htaccess sub domain as file parameter with all the variables)

problem i want to make this url redirect usin ...

字preSS定制的mod_rewrite - totalnoob?(Wordpress custom mod_rewrite - totalnoob)

problem i'm trying to make a custom mod_rewrite rule for ...

我怎样才能让我的网址,从这个例子中友好吗?(How can I make my urls friendly from this example)

problem my site currently displays like this (when clicki ...

htaccess的问题强制SSL(.htaccess issue to force SSL)

problem i activated ssl on one of my sites (based on word ...

IfModule不会出现是工作?(IfModule doesn't appear to be working)

problem if i use this: lt;ifmodule mod_rewrite.cgt; rewr ...

我怎样才能利用外界信息的URL重写?(How can I get use outside information in url rewrites)

problem hopefully some of you .htaccess gurus can help me ...

基于URL到一个新的页面的RewriteCond重写规则进行的.htaccess,定期EX pression(RewriteCond RewriteRule for .htaccess based on URL to a new page, regular expression)

problem i have an interesting rewriterule and i am not su ...

的.htaccess,mod_rewrite的,正则表达式用目录和文件类型(.htaccess, mod_rewrite, regex with directory and filetype)

problem i want to do a rewrite with the following conditi ...

.htaccess的语言重定向310错误(Htaccess language Redirect 310 error)

problem i have a two language site swedish sidewww.site ...

重定向一切的index.php(Redirection everything to index.php)

problem i wan't to redirect everything to index.php exepe ...

生成SE友好的URL的.htaccess国防部重写(Generating SE friendly URL .htaccess mod rewrite)

problem i've a url which get file name through get method ...

htaccess的子域名重定向(htaccess subdomain redirect)

problem i've searched around and tried a few ...

UrlRewrite 3 GET请求(UrlRewrite with 3 get request)

problem i'm working on a project and stuck on urlrewrite. ...

mod_rewrite的:恶意重定向(Mod_ReWrite: Unwanted redirect)

problem possible duplicate: .htaccess, clean ...

限制用户子目录(limiting users to subdirectories)

problem i have a subdirectory of users that i want to lim ...

重定向子文件夹的.htaccess(Redirection Subfolder Htaccess)

problem i want a redirect using htaccess i have a post na ...

使用的.htaccess,从来没有表现出的index.php(Using .htaccess, never show index.php)

problem how can i never show index.phpfor example, all re ...

在子域的内部服务器错误(internal server error in subdomains)

problem i installed worpress to my main domain abcd.com. ...