为什么除非我在 URL 末尾添加 .html,否则我的页面不会显示?
由于某种原因,在转移到新服务器后,我的发票页面和脚本无法正常工作。当客户输入他的信息时,它会被放入数据库中,并创建一个发票,如下所示:
/Invoices/JohnDoe 10100188
但是,该 URL 应该打开一个漂亮的发票页面,其中包含订单的所有信息,但我现在收到 404 错误。脚本或数据库没有任何变化。我们只是将它们和所有包含的文件移动到新服务器。更奇怪的是,当您将 .html 添加到 JohnDoe 10100188 的末尾时,它将加载该页面。我不知道为什么,但我现在需要让我的脚本在末尾添加 .html 吗?我很困惑为什么这现在行不通。我希望有人有类似的问题并可以帮助我。我将不胜感激!
For some reason after transferring to a new server my invoices page and script aren't working. When a customer enters his information it is put in the database and it creates an invoice like so:
/Invoices/JohnDoe 10100188
However the URL should open up a nice invoice page with all the info for the order, instead I get a 404 Error now. Nothing has changed with the script or databases. We simply moved them to a new server and all the included files. What's even stranger is that when you add .html to the end of JohnDoe 10100188 it will load the page. I don't know why but do I need to make my script add .html at the end now? It is confusing to me why this won't work now.. I was hoping someone had a similar problem and could help me out. I would be greatly appreciative!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 Apache 不太熟悉,但我的猜测是有一个配置设置,您可以在未提供文件扩展名的情况下设置默认文件扩展名。
可能位于 .htaccess 或 Apache 配置文件之一中。
I'm not too familiar with Apache, but my guess would be that there's a configuration setting where you can set a default file extension for the case when one is not supplied.
Could be in .htaccess, or one of the Apache config files.