我正在开发一个与Laravel一起开发的本地版网站。我有一个URL,如:http://localhost/s/SEO/userinstall,它返回一个404错误。在app/Http/Broades.php中,我尝试了以下操作,但仍然得到了相同的错误:
Route::get('userinstall', 'InstallController@userinstall');
Route::post('userinstall', 'InstallController@saveUser');然后我试着
Route::get('s/SEO/userinstall', 'InstallController@userinstall');
Route::post('s/SEO/userinstall', 'InstallController@saveUser');我在文件中检查了AllowOverride指令,它似乎很好:
<Directory />
AllowOverride All
</Directory>我使用的是.htacess文件。知道我怎么能解决这个问题吗?
谢谢
发布于 2015-07-01 20:21:47
通过查看您的URL,http://localhost/s/SEO/userinstall
我假设s->SEO是apache根目录下的目录,因为您必须在Route::get('s/SEO/userinstall', 'InstallController@userinstall');中使用"s/SEO/userinstall“
您应该添加网站路径"../s/SEO"的Apache配置,指定特定的域名。例如http://sandbox.local,使您可以从http://sandbox.local/userinstall访问站点。
这样,您就可以通过
Route::get('userinstall', 'InstallController@userinstall');尝试搜索它,以了解如何设置您的项目通过本地域访问。
这是一个可能对你有帮助的URL。http://headsigned.com/article/setting-up-local-development-domain-with-apache-vhosts
https://stackoverflow.com/questions/31168207
复制相似问题