自从更新我的虚拟主机以便我可以在dev.mysite.com而不是之前的localhost / mysite / public上查看我的应用程序,我无法让应用程序拥有“漂亮的网址”。
只有在我使用dev.mysite.com/index.php/register
时才会有效如何修改设置,以便在dev.mysite.com/register
中查看htaccess的
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
routes.php文件
Route::get('register', array('uses' => 'UserController@create'));
HTTPD-VHOSTS.CONF
NameVirtualHost *
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs/mysite/public"
ServerName dev.mysite.com
</VirtualHost>