簡體   English   中英

.htaccess子目錄到子目錄

[英].htaccess subdirectory to subdirectory

我已經為Intranet編寫了一個Web應用程序,但是我的鏈接並不與實時服務器上的鏈接導航保持一致。 喜悅。

我知道您在想什么:正確編寫您該死的應用程序。 注意。

我想知道是否有一個mod_rewrite / htaccess技巧可以將我發送出去。

/http://example/[admin/generic]/etc/etc2/this_stays_the_same.file

..至..

/http://example/[src/reports]/etc/etc2/this_stays_the_same.file

當我將它們放在admin / generic目錄中時,只需將其轉換為方括號即可。

如果有,那將是整潔的。

謝謝!

如果在瀏覽器中輸入http://example/src/reports/... ,則可以使用簡單的Redirect

Redirect /src/reports /admin/generic

更新

如果您不想在瀏覽器欄中顯示/admin/generic/... URL,則必須重寫而不是重定向

RewriteEngine on
RewriteRule ^src/reports/(.*)$ /admin/generic/$1 [L]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM