简体   繁体   English

在不影响 SEO、Google Analytics 的情况下将域永久移动到子目录

[英]Permanently moving a domain to subdirectory without affecting the SEO, Google Analytics

I have a wordpress website footballfriendsonline.com and it has almost 22,000 blog posts running with SEO google analytics for the past 6 years, all the contents are scattered in almost all social media and backlinked in a lot of websites.我有一个 wordpress 网站footballfriendsonline.com在过去的 6 年里,它有近 22,000 篇使用 SEO 谷歌分析的博客文章,所有内容都分散在几乎所有社交媒体中,并在许多网站中反向链接。 The issue is I'm planning to start afresh news aggregator site with the same old web address 1 I want to move the old blog contents to the subdirectory ie footballfriendsonline.com/blog and I want to run the same old blogging in 2 without affecting the SEO and also want to run the fresh startup aggregator site in 1 .问题是我打算使用相同的旧 web 地址1重新启动新闻聚合器站点 我想将旧博客内容移动到子目录,即footballfriendsonline.com/blog并且我想在2中运行相同的旧博客而不影响SEO 并且还想在1中运行新的启动聚合器站点。

I tried with 301 redirections by updating .htaccess file and I failed in getting desired output.我通过更新 .htaccess 文件尝试了 301 重定向,但未能获得所需的 output。

Anyone, please help me with this...任何人,请帮我解决这个问题...

You can do that.. Transparently redirect your root directory to a subdirectory...你可以这样做......透明地将你的根目录重定向到一个子目录......

  1. Log into cPanel登录 cPanel
  2. File Manager文件管理器
  3. Edit the .htaccess file编辑 .htaccess 文件
  4. Add the following code to the .htaccess file:将以下代码添加到 .htaccess 文件中:

     RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?footballfriendsonline.com$ RewriteCond %{REQUEST_URI}.^/blog/ RewriteCond %{REQUEST_FILENAME}.-f RewriteCond %{REQUEST_FILENAME}?-d RewriteRule ^(.*)$ /subdirectory/$1 RewriteCond %{HTTP_HOST} ^(www?).footballfriendsonline.com$ RewriteRule ^(/)?$ blog/index.php [L]

this will work for you.这对你有用。 please check...请检查...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM