2009-09-14 38 views
0

U使用了重寫url模塊,但無法重定向到目標頁面,出現錯誤在此服務器上找不到請求的URL /old.htmlMultiwrite Rule中的問題

這是我的代碼。請參閱該和建議我:

RewriteEngine On 
RewriteCond %{SERVER_PORT} !^8080$ 
RewriteRule ^(.*)$ http://localhost/IN/$1 [L,R] 
RewriteRule ^new.html$ /index.html$1 [L] 

回答

0

你的第一條規則可能會導致無限規則作爲替代URL不使用的端口8080都不是。所以,試試這個:

RewriteCond %{SERVER_PORT} !^8080$ 
RewriteRule ^(.*)$ http://localhost:8080/IN/$1 [L,R] 

您還需要申請/new.html,看看你的第二個規則的作品。此外,您的模式中沒有第一組可匹配$1。所以:

RewriteRule ^new\.html$ /index.html [L]