网站已移动,现在图像已损坏
不确定这应该在这里还是服务器故障,所以如果我错了,请道歉。
我刚刚将我的网站从服务器上的一个文件夹移动到另一个文件夹(发生的情况是,我正在进行更新,但不太有效,所以我将所有旧文件传回)。现在我在网站上的所有图像都已损坏。
有谁知道为什么会发生这种情况?或者更重要的是如何解决它?
任何帮助/建议将不胜感激! 谢谢
编辑: 好吧,显然我需要确保代码已编译,但完全不知道如何做到这一点......有什么想法吗?
我也在运行 IIS7 的 Windows 2008 服务器上。该应用程序是用 C# .net MVC 编写的。
Unsure if this should be on here or serverfault so apologies if I'm wrong.
I just moved my site from one folder to another on my server (what happened was, I was doing an update, which didn't quite work, so I transferred all the old files back). Now all my images on the site are broken.
Does anyone know why this happens? Or how to fix it more importantly?
Any help/advice would be appreciated!
Thanks
EDIT:
Okay, apparently I need to make sure the code is compiled, but completely lost as to how to do this..any ideas?
I'm also on a windows 2008 server, running IIS7. The application is written in C# .net MVC.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于应用程序正在运行,因此您似乎没有遇到编译问题。我的意思是,如果您可以运行该网站,但只是缺少图像,请尝试查找路径并检查图像文件是否在其中。
对于 MVC (C#) 应用程序,您应该有这样的目录:
“root”将成为您在 Web 服务器上的第一个公共文件夹
希望它有帮助!
It doesn't seems that you have a compilation problem since the aplication is working. I mean, if you can run the website, but you are only missing the images, try to look for the paths and check if the image files are in there.
For an MVC (C#) app you should have the directory like this:
´root´ is gonna be your first public folder on the WebServer
Hope it helps!
确保图像文件(以及与此相关的任何文件)的路径相对于网站的根目录。这样,如果您将与网站相关的所有文件从一个位置移动到另一个位置,所有内容都保持相对状态,不会损坏任何内容。
Make sure the paths to your image files (and any files for that matter) are relative to the root directory of your web site. This way, if you ever move all of the files pertaining to your web site from one location to another, everything stays relative and nothing should be broken.