![](/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.