我的 bitnami wamp vhost 无法正常工作
my bitnami wamp vhost doesn't working properly
我用:
- Windows 7 终极版 x64
- Bitnami WAMP 堆栈 5.6.22-0
- Laravel 5
我做了什么:
- 编辑我的
%systemroot%\System32\drivers\etc\hosts
文件,在行尾添加 127.0.0.1 juke.dev
- 编辑我的
httpd.conf
- 取消注释行
LoadModule vhost_alias_module modules/mod_vhost_alias.so
- 取消注释行
Include conf/extra/httpd-vhosts.conf
将我的httpd-vhosts.conf
编辑成这样:
<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot "C:/WAMP/apache2/htdocs/claim/public"
ServerName juke.dev
<Directory "C:/WAMP/apache2/htdocs/claim/public">
Require all granted
</Directory>
</VirtualHost>
安装composer
和laravel5
把我的laravel5
routes.php
编辑成这样:
Route::get('/', 'WelcomeController@index');
Route::get('contact', 'WelcomeController@contact');
- 而
WelcomeController
是这样的:
现在进入问题
- 当我去
juke.dev
时,它成功了。
- 当我转到
juke.dev/contact
时,它失败了。
- 当我去
localhost/claim/public/contact
时,它成功了。
我做错了什么?
我在网络编程方面还是个新手,所以任何解释都会有所帮助
奇怪的问题:
这是我的虚拟主机示例:
<VirtualHost *:80>
DocumentRoot "G:\Google Drive\Data\Proj\public"
ServerName rethinkdb.i
ServerAlias www.rethinkdb.i
<Directory "G:\Google Drive\Data\Proj\public">
AllowOverride All
Require all Granted
</Directory>
</VirtualHost>
我能想到的另一件事可能是您的 .htaccess 文件。
看起来怎么样?
已编辑:
刚试过你的虚拟主机,有同样的问题。所以尝试使用上面这里的虚拟主机。
我用:
- Windows 7 终极版 x64
- Bitnami WAMP 堆栈 5.6.22-0
- Laravel 5
我做了什么:
- 编辑我的
%systemroot%\System32\drivers\etc\hosts
文件,在行尾添加127.0.0.1 juke.dev
- 编辑我的
httpd.conf
- 取消注释行
LoadModule vhost_alias_module modules/mod_vhost_alias.so
- 取消注释行
Include conf/extra/httpd-vhosts.conf
- 取消注释行
将我的
httpd-vhosts.conf
编辑成这样:<VirtualHost *:80> ServerAdmin root@localhost DocumentRoot "C:/WAMP/apache2/htdocs/claim/public" ServerName juke.dev <Directory "C:/WAMP/apache2/htdocs/claim/public"> Require all granted </Directory> </VirtualHost>
安装
composer
和laravel5
把我的
laravel5
routes.php
编辑成这样:Route::get('/', 'WelcomeController@index'); Route::get('contact', 'WelcomeController@contact');
- 而
WelcomeController
是这样的:
现在进入问题
- 当我去
juke.dev
时,它成功了。
- 当我转到
juke.dev/contact
时,它失败了。
- 当我去
localhost/claim/public/contact
时,它成功了。
我做错了什么?
我在网络编程方面还是个新手,所以任何解释都会有所帮助
奇怪的问题:
这是我的虚拟主机示例:
<VirtualHost *:80>
DocumentRoot "G:\Google Drive\Data\Proj\public"
ServerName rethinkdb.i
ServerAlias www.rethinkdb.i
<Directory "G:\Google Drive\Data\Proj\public">
AllowOverride All
Require all Granted
</Directory>
</VirtualHost>
我能想到的另一件事可能是您的 .htaccess 文件。
看起来怎么样?
已编辑: 刚试过你的虚拟主机,有同样的问题。所以尝试使用上面这里的虚拟主机。