簡體   English   中英

重定向到子目錄

[英]Redirect to subdirectory

我在這里和Google上搜索過,似乎無法正確顯示。

我的根目錄中有一個.htaccess文件...我希望將站點的所有地址都轉到子目錄(/foo.com/public_html/)並設置baseDirectory。

/.htaccess
Options +FollowSymLinks
Options -MultiViews
RewriteEngine on
RewriteBase /foo.com/public_html/

rewritecond %{http_host} ^bar.com [nc]
rewriterule ^(.*)$ http://www.bar.com/$1 [r=301,nc]
rewriterule ^$ /foo.com/public_html/ [nc]

這是否有幫助:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursitename\.com$
RewriteRule (.*) http://www.yoursitename.com/$1 [R=301,L]
RewriteRule ^$ yoursub-directoryname[L]

暫無
暫無

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

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