简体   繁体   中英

htaccess Rewrite Cond to remove string from URL

i have some problems with links to my website. For example:

http://example.com/service/ www.blabla.de

I want to remove the string "www.blabla.de" via htaccess. Can everybody help me?

It is possible that after "www.blabla.de" comes a query string for example: http://example.com/service/ www.blabla.de ?query=test

The string must be in the URL.

Thank you

You can use this redirect rule in site root .htaccess:

RewriteEngine On

RewriteRule ^(service)/www\.blabla\.de/?$ /$1? [L,NC,R=301]

? at the end of target URI will strip off previous query string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM