2012-04-29 24 views
2

我有以下地址: le%20coin%20de%20l’auteur%20-%20biographie%20de%20Cathérine%20Boullery.html 其中包括空格,報價和帶有口音的一封信。htaccess的重定向與白的空間,報價和E

我想用這樣的: redirect 301 /this-above-url http://telecharger-ebook-roman-fantasy-aila-pdf-fr.fr//le-coin-de-l-auteur-biographie-de-catherine-boullery.html

我有幾頁與這些奇怪的字符重定向並與htaccess沒有經驗,但我看到,試着去了解和複製...

回答

1

您應該圍繞url-path使用引號,並使用非編碼字符。類似以下內容:

redirect 301 "le coin de l’auteur - biographie de Cathérine Boullery.html" http://telecharger-ebook-roman-fantasy-aila-pdf-fr.fr//le-coin-de-l-auteur-biographie-de-catherine-boullery.html 

這樣做對我的測試服務器無效。

什麼工作是使用mod_rewrite。

RewriteEngine On 
RewriteBase/

RewriteRule "^le coin de l’auteur - biographie de Cathérine Boullery.html$" http://telecharger-ebook-roman-fantasy-aila-pdf-fr.fr//le-coin-de-l-auteur-biographie-de-catherine-boullery.html [R=302,L] 
+0

謝謝你的回答(和測試)。我也測試過它(從來不知道),它也失敗了...... – tibibou

+0

然而'RewriteRule'工作嗎? – Gerben

+0

與其他案件,我確保重寫規則正在工作。這裏是我的.htaccess文件的摘錄: 選項+的FollowSymLinks #重定向舊網頁 RewriteBase/ 重寫規則default.html中http://telecharger-ebook-roman-fantasy-aila-pdf-fr.fr/index。 html#OK RewriteRule「^ le coin de l'auteur - biographie de Catherine Boullery.html $」http://telecharger-ebook-roman-fantasy-aila-pdf-fr.fr/le-coin-de-l- auteur-biographie-de-catherine-boullery.html [R = 302,L]#not OK – tibibou