![](/img/trans.png)
[英].htaccess 301 redirect old domain sub-folder without root domain access to new domain root
[英]htaccess 301 redirect domain/folder to new sub.domain
我一直在尋找,但找不到如何執行此重定向。 舊網址是
http://nilandsplace.com/LinuxBlog/
我想將其移至:
http://blog.nilandsplace.com/linux/index.php
我嘗試的所有重定向都給我一個500服務器錯誤或此URL /找不到的401頁面
http://blog.nilandsplace.com/linuxLinuxBlog/
我在根目錄/ LinuxBlog /中創建了一個文件夾,並將.htaccess放入其中。我似乎無法擺脫/ LinuxBlog
RewriteEngine On
# if you want to redirect everything to index.php
RewriteCond %{HTTP_HOST} ^nilandsplace\.com$ [NC]
RewriteRule ^LinuxBlog/ http://blog.nilandsplace.com/linux/index.php [R=301]
# if you want to keep the page requested and forward it to the new URL
RewriteCond %{HTTP_HOST} ^nilandsplace\.com$ [NC]
RewriteRule ^LinuxBlog/(.*)$ http://blog.nilandsplace.com/linux/$1 [R=301]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.