2016-04-19 30 views
2

Wie leite ich:Redirect-URL mit htaccess und regulären Ausdruck

https://www.portal-gestao.com/entrar-na-sua-conta.html?redirecionar=/f%C3%B3rum-perguntas-e-respostas/conversation/read.html?id=25 

An:

https://www.portal-gestao.com/f%C3%B3rum-perguntas-e-respostas/conversation/read.html?id=25 

.htaccess und regex verwenden?

Ich versuche:

RewriteCond %{THE_REQUEST} /entrar-na-sua-conta.html?redirecionar=/([^\s&]+) [NC] 
RewriteRule^https://www.portal-gestao.com/%1? [L,R=302] 

Und:

RewriteRule ^entrar-na-sua-conta.html?redirecionar=/(.*)$ /$1 [R=301,L] 

Antwort

0

? ist ein spezielles Zeichen in Regex, also müssen Sie es im Cond-Muster entkommen, um zu entsprechen? wörtlich:

RewriteCond %{THE_REQUEST} /entrar-na-sua-conta.html\?redirecionar=/([^\s&]+) [NC] 
RewriteRule^https://www.portal-gestao.com/%1? [L,R=302]