dongling4288 2014-05-28 09:12
浏览 18
已采纳

A-Record / CNAME / .htaccess repointing [关闭]

I have a domain www.example.com that is shutting down, but I need to forward it to www.newwebsite.com/example/ incase there are any SEO benefits to it.

The newwebsite.com is hosted on a LAMP stack virtual server so I have full access to everything. The example.com website hosting has lapsed and so we need to make the repointing at DNS level.

I think I can see two ways of doing this and would like some guidance please!

Route A - Repoint the a-record of example.com, then setup some kinda of virtual host on the newwebsite.com server. Then repoint within that virtual hosting to www.newwebsite.com/example/

Route B - Repointing with cname and use the .htaccess of the www.newwebsite.com/ to point all traffic coming from that address to www.newwebsite.com/example/.

I know how to repoint, but have no idea of what to setup on the new server, all thoughts/help welcome.!

  • 写回答

2条回答 默认 最新

  • dongyue5686 2014-06-03 18:10
    关注

    Thanks for all the helpful guidance, I took it all on board and thought I would post back what I actuall did incase someone else needs a breakdown. To be clear, my hosting is a VPS on a LAMP stack running Ubuntu.

    1. Repointed the a-record of the old site to the new one.
    2. Created a config file in the sites-available folder of apache2
    3. Pointed that config file to where I wanted the hosted folder to be, in my case home/www/vhosts/
    4. Created a folder in the above in the name of the old website
    5. Added the .htaccess file in that folder with the 301 redirect in it.
    6. Made the website active my using the a2ensite command
    7. Restarted apache
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建