邮差总是返回404

邮差总是返回404

问题描述:

I have a lot of projects on my local Apache. Everything is set correctly in httpd.conf and every project can be launched in the browser as project-name.localhost.

Problem is if I want to test it over postman. It always returns 404. Every page where is not any authorisation finished by the same way. All I do is copy the URL from browser, paste it to postman, choose GET method and submit it.

Is in postman any settings which I have to do before testing?

我的本​​地Apache上有很多项目。 一切都在 httpd.conf code>中正确设置,每个项目都可以在浏览器中以 project-name.localhost code>的形式启动。 p>

问题 如果我想通过邮递员测试它。 它总是返回404.每个页面都没有任何授权以同样的方式完成。 我所做的只是从浏览器中复制URL,将其粘贴到邮递员,选择GET方法并提交。 p>

邮递员在测试之前是否需要进行任何设置? p> div>

I ran into a similar problem, for some reason postman didn't like how I configured apache2 domain aliasing on my machine... but of course it works perfectly fine on my co-workers.

I switched the uri in postman to bypass the vhost.conf / sites.conf

from: http://my-project.laravel5.localhost:port/foo/bar
to: http://localhost:port/laravel/5/my-project/public/foo/bar

  • I'm hosting laravel in ~/Sites/laravel/5/my-project/ - so my uri reference starts at the sub directory laravel.

  • If you are hosting apache2 on :80 you don't need to specify the port here, but if you're hosting on :8080 you would have to specify localhost:8080/ect... While not a valid solution, I hope this helps.