2012-10-30 41 views
2

任何人都知道如何重定向比例(%)中的Joomla博客文章鏈接斷裂部位

域/博客/ 208 - % - 的top.html

要:

domain/blog/208-top.html

in Joomla?

無以下作品:

RewriteRule ^blog/208-%-top.html$ 208-top.html [R=301,L] 
RewriteRule ^blog/208-\%-top.html$ 208-top.html [R=301,L] 
RewriteRule ^blog/208-.*-top.html$ 208-top.html [R=301,L] 

它的工作原理,如果:網址有%20%25和htaccess的

RewriteRule ^blog/208-%20-top.html$ 208-top.html [R=301,L] 
RewriteRule ^blog/208-%25-top.html$ 208-top.html [R=301,L] 

下面有但問題是,博客文章只有%。有沒有解決這個問題的方法?

回答

1

此網址:

domain.com/blog/208-%-top.html 

確實是一個無效的URL,並會造成HTTP 400(錯誤請求)錯誤在你的Apache日誌。

正如你還指出,這些2個網址都是有效的:

domain.com/blog/208-%20-top.html 

OR

domain.com/blog/208-%25-top.html 

而且他們都將與此重寫規則運行良好:

RewriteRule ^blog/208-\%-top\.html$ blog/208-top.html [R=301,L,NC] 
0

你的問題可能是因爲Apache沒有正確識別你的重寫目標爲URL路徑,你需要包括完整的路徑來解決這個問題。

RewriteRule ^blog/208-\%-top.html$ /blog/208-top.html [R=301,L] 
相關問題