我試圖尋找,但只有想出了用RewriteMap指令(我如果甚至需要這種以前從來沒有..和不知道使用的解決方案重定向?.htaccess的302資本路徑
使用這個的.htaccess在線測試儀,它表明我的努力會工作,NIT在實踐中....他們不
網址: http://www.somedomain.com/ABCD/somthing-else/another-directory
應該重定向到: http://www.somedomain.com/abcd/somthing-else/another-directory
基本上任何和所有: http://www.somedomain.com/ABCD
應該重定向到: http://www.somedomain.com/abcd
一切(如果有的話在所有)的ABCD後/應保持並傳遞給新的ABCD/URL ?
我嘗試這樣做:
RewriteRule ^AAEM18 /aaem18 [NC,R=301,L]
哪個測試儀現場說:
新的URL是http://www.somedomain.com/abcd/somthing-else/another-directory
但是當我上傳新的.htaccess文件..
它只是去到:
http://www.somedomain.com/abcd
'ReWriteMap'在apache的conf是正確的解決方案。但如果你必須在.htaccess中完成,你可以試試這個方法https://serverfault.com/questions/777577/apache-rewrite-all-urls-to-lowercase-if-contains-at-least-one -uppercase – masterfloda