简体   繁体   English

.htaccess重写域,但保留目录结构并在地址栏中保留url

[英].htaccess rewrite domain but keep directory structure and preserve url in address bar

I have copied a Joomla site from one domain to a new domain. 我已经将Joomla网站从一个域复制到了一个新域。

I want to rewrite the domain name only to keep the directory structure. 我只想重写域名以保留目录结构。

And I want to keep the original URL in the address bar to preserve SEO ranking. 我想将原始URL保留在地址栏中以保持SEO排名。

Joomla is using relative url's, so the real domain name of the new server will not as such be invoked by Joomla. Joomla使用的是相对网址,因此Joomla不会这样调用新服务器的真实域名。

How to do this in .htaccess on Apache? 如何在Apache的.htaccess中做到这一点?

And I want to keep the original URL in the address bar to preserve SEO ranking. 我想将原始URL保留在地址栏中以保持SEO排名。

That won't help you really, just add proper 301 redirects and make sure you catch as much of the indexed url's with your redirects component within joomla to prevent any dead links (google hates those and will penalize your domain for it). 但这对您没有真正的帮助,仅添加适当的301重定向,并确保您在joomla中使用重定向组件捕获尽可能多的索引网址,以防止出现任何无效链接(Google讨厌这些无效链接,因此会对您的网域造成不利影响)。 Also add sitemap, upload it to your google webmaster tools and ask google to index it. 还添加站点地图,将其上传到您的Google网站管理员工具,并要求Google将其编入索引。

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

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