dsgw3315 2014-11-17 07:38
浏览 41
已采纳

将laravel从godaddy转移到hostgator并且路线似乎不起作用

laravel was working fine when I am hosting with GoDaddy but recently I transferred my domain to hostgator first time on hostgator and so I moved all laravel contents from GoDaddy to Hostgator by downloading everything from ftp then transferred all files over. Database with godaddy and hostgator are different and so I created database in hostgator and implement everything needed but somehow when I load up my page in hostgator my page loads but when I click on any of the links in the page I keep on getting the 404.html.

At first I thought it was because my database info isn't set correctly because it's my first using using hostgator and their database uses localhost instead of like GoDaddy it has an ip for me to use as a host.

Anyways then I uploaded some other things into hostgator which isn't using laravel just normal php with database info and this works fine. So now I am confused if it is because of laravel or it is hostgator? I have no idea where to start looking for what the problem is

I was told by hostgator that they can migrate contents at a charge and everything will work perfectly the same as it was with godaddy but I figured this is a time I can learn if anything happens

I am sorry if this a stupid question. Can someone please give me a hand? Thanks a lot

my folder structure

-root
   -public_html
      -user-login (laravel folder)

P.S. I have a free account with aws ec2 and I tried transferring all the files into aws-ec2 and I can see other pages fine just that let's say if I try to login it gives me errors which is normal since I didn't have database setup correctly but at least the links works

  • 写回答

1条回答 默认 最新

  • doufutao4428 2014-11-26 21:21
    关注

    Alright, I found out why and pretty much my stupidity I believe. Somehow, as I said using hostgator (without a domain) I was loading the page using http://ip/myname/laravel/public and I can only see the index page any other links gives me error404. I was still waiting for my domain transfer at that time so I had to load my page with my ip/username in order to load my pages.

    Somehow after my domain is transferred and namespace is set in place. For example my domain is www.domain.com after the transfer is complete and namespace is setup in hostgator now I can load the page as http://www.domain.com/laravel/public AH~ and all links are working fine as before.

    No idea what's the real reason behind this but after this, everything works like a charm now

    If anyone has an idea the reason why, I wouldn't mind you posting / commenting here to gain my knowledge

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因