我在爲某些網址做重定向時遇到問題,那些來自舊網站的網址有一個?登錄,不會重定向,其他每個網址都會執行。 例如: OLD: /laser-alignment-resources/presentations.cfm?pres=diaphragm.htaccess使用動態網址重定向
新: http://www.acquip.com/en/presentations/47-presentation-internal-laser-diaphragm-alignment
都不行,我相信我做錯了什麼事,但我是一個的n00b當涉及到的.htaccess
所有網址都在相同的格式,14總數:
OLD:/laser-alignment-resources/presentations.cfm PRES =氣體 新:http://www.acquip.com/en/presentations/48-presentation-gas-turbine-thermal-alignment
OLD:/laser-alignment-resources/presentations.cfm?pres=train 新:http://www.acquip.com/en/presentations/49-presentation-complete-machine-train-alignment
任何幫助將不勝感激。
對不起,如果我不清楚,但你實際上已經發現它很好,我使用301重定向而不是mod_rewrite。 我剛剛嘗試使用mod_rewrite,它也不能正常工作。 我打電話給託管公司,他們說他們在他們的服務器上啓用了mod_rewrite。 它還能是什麼? – Terumo 2010-08-04 16:47:50
沒問題,我只是想確保我提供了一個對你有用的答案。至於它不工作,我不知道爲什麼它不應該,但我今天下班後會進行調查,看看我能否提出一個替代解決方案。 – 2010-08-05 10:28:01
@Terumo - 嗯,它可以在我的測試服務器上正常工作。當您訪問連接了查詢字符串的URL時,什麼都不會發生?你可以測試'mod_rewrite'通常使用像'RewriteRule^rewrite-test $ http://stackoverflow.com/ [R = 301,L]'這樣的規則並轉到那個'rewrite-test' URL並看到如果你被重定向到堆棧溢出。 – 2010-08-06 04:06:43