![](/img/trans.png)
[英]Ubuntu - trouble securing *.mydomain.com and *.sub.mydomain.com using different certs
[英]Moved site, make old links redirect with .htaccess? From sub.mydomain.com to mydomain.com
我最近將博客從
http://blog.mydomain.com
至
http://mydomain.com
我現在的問題是我的網站鏈接到舊地址。
例如,我可以在.htaccess文件中放入什么內容,
http://blog.mydomain.com/my-post-title-here
去
http://mydomain.com/my-post-title-here
提前致謝!
回答了我自己的問題。 我將其放在“博客”子域的根目錄中:
rewriteEngine on
rewriteBase /
rewriteCond %{HTTP_HOST} ^blog.mydomain.com$
rewriteRule ^(.*) http://mydomain.com/$1 [L,R=301]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.