URL使用htaccess的改变部分 [英] Change Part of URL using htaccess

查看:111
本文介绍了URL使用htaccess的改变部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个像

  • www.abc.com/pqr
  • www.abc.com/sss/pqr/abc
  • www.abc.com/ass/pqr/asd/dff

我想改变PQR一些其他的字,而不会影响原有的functionlaity。

I want to change the pqr to some other word without affecting original functionlaity.

目前我做了这样的事情

重写规则^ PQR /(.*) http://www.mysite.com/someotherword/ $ 1 [L]

RewriteRule ^pqr/(.*) http://www.mysite.com/someotherword/$1 [L]

但它影响到像搜索,登录功能。它越来越重定向我想要的方式。

But it is affecting functionality like search, login. it is getting redirect the way i want it.

请帮忙

推荐答案

如果你只想更换PQR的一部分,这是重写规则: 重写规则^()PQR(。的)$ $ 1someotherword $ 2 [L]

If you want just to replace the "pqr" part, this is the rewriterule: RewriteRule ^(.)pqr(.)$ $1someotherword$2 [L]

这篇关于URL使用htaccess的改变部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆