URL使用htaccess的改变部分部分、URL、htaccess

2023-09-02 01:08:35 作者:有尸必有我

我有一个像

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]