Apache Mod Rewrite For Laravel

后端 未结 5 1967
野趣味
野趣味 2020-11-29 05:26

I have an installation of Laravel on Wampserver. The directory is as follows:

C:\\wamp\\www\\laravel

Now URLs are like this:

http://localhost/

5条回答
  •  旧时难觅i
    2020-11-29 06:16

    As a newb to WAMP and Laravel, I struggled at bit but did get the virtualhost thing to work on my WIN7PRO 64-bit box. In WAMPSERVER/Apache/hppd.conf at the end of the file, I added:

    NameVirtualHost *:80
    
    
     DocumentRoot C:/webapp/public
     ServerName webapp
     
       Options Indexes FollowSymLinks MultiViews
       AllowOverride all
       Order Deny,Allow
       Allow from All
      
     
    
    
     DocumentRoot C:/wamp/www
     ServerName localhost
     
    

    and I added:

    127.0.0.1 webapp

    to the hosts file. (I was never successful editing the vhosts files, as many posts on the web suggested.)

    These changes allow me to get to my Laravel test app in my browser via

    http://webapp
    (and also, via just http://127.0.0.1)
    

    and, to get to all my other sites, via:

    http://localhost/devsite/whatever..
    

提交回复
热议问题