簡體   English   中英

如何顯示 domain.com/subdomain 而不是 subdomain.domain.com

[英]How to show domain.com/subdomain instead of subdomain.domain.com

我不想將用戶從subdomain.domain.com重定向到domain.com/subdomain但我想從/home/mysite/public_html/domain.com讀取數據但讓 URL 似乎是從 sub-目錄。 我怎樣才能做到這一點?

我試過.htaccess文件,但它只是重定向,但我希望它只顯示在 URL 中。

RewriteCond %{HTTP_HOST} ^subdomain.example.com
RewriteRule ^(.*)$ https://example.com/subdomain/$1 [L,NC,QSA]

我正在使用 WordPress。 為什么我不從子域移動到子目錄? 因為我同時使用 WordPress 和 Laravel。 那個有很多錯誤完全阻止了我無法繼續。 所以我把它放在子域中。

嘗試將 301 所有頁面從 domain.com 重定向到 subdomain.com,所有 wordpress 安裝。

暫無
暫無

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

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