0
類似的重複關鍵字我有這個網址:移除/刪除從URL的htaccess
http://www.domain.net/iphone-reparatur-bremen/iphone-6-**reparatur**
,並希望這樣的:
http://www.domain.net/iphone-**reparatur**-bremen/iphone-6
我有很多鏈接(200+)這樣的。
如何從url中刪除最後一個單詞「reparatur」?
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
RewriteBase/
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
RewriteCond %{HTTP_HOST} (www\.)xn--domain-3ya.de
RewriteRule (.*) http://www.domain.de [L,R=301]
RewriteRule ^([^-/]+-([^/-]+)-[^/]+/.+?)-\2\b /$1 [NC,L,R=302]
#RewriteRule ^(iphone-([^/]+)-[^/]+/iphone-\d)-\2\b /$1 [NC,L,R=302]
RewriteCond %{QUERY_STRING} ^_=([^&]*) [NC]
RewriteRule^%{REQUEST_URI}?.html=%1 [R,L]
#Für weiterleitung von/auf root
Redirect 301 /de/ http://www.domain.de/
#haupt-kategorien
Redirect 301 /handy http://www.domain.de
Redirect 301 /handy-reparatur http://www.domain.de
Redirect 301 /handy-reparatur-bremen http://www.domain.de
而且有很多301 .. ignoremeignoremeignoremeignoremeignoremeignoremeignoreme
真的感謝快速回復!我測試了它,但沒有奏效。我有不同的網址,比如像「www.domain.net/samsung-reparatur-bremen/samsung-galaxy-s5-mini-reparatur」 – recep779
沒有人missunderstand:D我說'它不起作用'... :) – recep779
好吧現在嘗試我的更新規則。 – anubhava