Apache Mod Rewrite For Laravel

后端 未结 5 1965
野趣味
野趣味 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条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 06:06

    The easiest way I got this working on my local dev environment was to do the following:

    (Assuming you have WAMP installed in C:\WAMP)

    Create the following folder:

    c:\wamp\www\laravel
    

    Download laravel and put the contents in the above directory. You will know you have done it right if you can browse to hxxp://localhost/laravel/public and get the opening screen. However, this isn't good enough. We want to get that screen by going to http://localhost/laravel

    So then we do the following:

    Create a textfile containing the following:

    Alias /laravel "c:/wamp/www/laravel/public" 
    
    
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Allow from all
    
    

    Save this file as laravel.conf in the c:\wamp\alias directory.

    Finally, restart your wampserver.

    You should now be able to surf to http://localhost/laravel

    Note that the above is strictly for a local development environment.

提交回复
热议问题