htaccess 301 redirect -- remove a string

MOB

I am trying to do this htaccess 301 redirect, but I am stuck.

What I want is to remove a string in the URL, the string is: style=5&

I want the redirect it so all pages that may get that string in the URL will be removed. -- Thanks in advance.

FROM:

/viewtopic.php?style=5&f=45&t=1980&p=19136

TO:

/viewtopic.php?f=45&t=1980&p=19136
anubhava

You can use this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{QUERY_STRING} ^(.+?&)?style=5(?:&(.*))?$ [NC]
RewriteRule ^viewtopic\.php$ %{REQUEST_URI}?%1%2 [R=302,NC,L]

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

htaccess 301 redirect — remove a path

분류에서Dev

Redirect 301 in htaccess changes the url encoding

분류에서Dev

HTACCESS 301 redirect issue with strange url variables

분류에서Dev

htaccess redirect 301 https www to non www

분류에서Dev

htaccess 301 Redirect Wildcard for New Base Domain Name

분류에서Dev

.htaccess 500 internal server error when adding simple 301 redirect

분류에서Dev

.htaccess url rewrite remove string

분류에서Dev

301 .htacess redirect issue

분류에서Dev

htaccess redirect url query string to other string parameter

분류에서Dev

htaccess Rewrite Cond to remove string from URL

분류에서Dev

301 redirect for all get request

분류에서Dev

301 Redirect a folder to a single page

분류에서Dev

301 Redirect to a 302 Redirect (SEO implications)

분류에서Dev

Remove index.php, force ssl, and redirect www to non www in .htaccess

분류에서Dev

.htaccess does not redirect

분류에서Dev

Redirect rule not fired in htaccess

분류에서Dev

Redirect 301 on changed root name not working

분류에서Dev

301 redirect complete url to different extension, BUT with exceptions

분류에서Dev

301 htaccess 다시 쓰기

분류에서Dev

Magento htaccess 리디렉션 301

분류에서Dev

Proper htaccess 301 to prevent duplicate hostname issues?

분류에서Dev

Codeigniter : htaccess 301 리디렉션

분류에서Dev

Set up of conditional redirect in htaccess

분류에서Dev

htaccess redirect files to new domain

분류에서Dev

URL redirect not working with .htaccess not working

분류에서Dev

.htaccess Redirect from URL with parameters

분류에서Dev

htaccess - redirect removing part of url

분류에서Dev

htaccess redirect with unique id to title

분류에서Dev

Remove parts of url with htaccess