Many web frameworks have entry files similar to index. *, while laravel is server. php. Compared with other frameworks, the server in laravel. php often appears in URLs. For example, the home page is localhost, but when other pages are requested, the URL becomes local... index is similar in many web frameworks. *, while laravel is a server. php. Compared with other frameworks, the server in laravel. php often appears in URLs. For example, the homepage is http: // localhost/, but when other pages are requested, the URL is changed to http: // localhost/server. php/some. I personally think this is not beautiful, and there will be some Path Problems during development.
So I want to ask if I can remove the annoying 'server. php '. The following describes the methods I have tried:
I followed the online tutorial. First, I modified httpd. conf of Apache (I used Wamp)
1. Add "RewriteEngine on" to the next line of "Listen 80"
2. removed the comments before LoadModule rewrite_module modules/mod_rewrite.so.
3. Add a new Directory (the Directory already exists in the httpd. conf file. I'm not sure if it will happen again.
Directory content:
Options Indexes FollowSymLinks
AllowOverride All
Order deny, allow
Allow from all
4. Configure. htaccess in the laravel project file (square brackets are omitted because it cannot be displayed)
IfModule mod_rewrite.c Options +FollowSymLinks RewriteEngine OnIfModuleIfModule mod_rewrite.c RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ server.php/$1 [L]IfModule
5. Add 'server' => ''to app/config/local/app. php '',
At this point, the configuration is complete, but the problem persists. 'server. php' does not disappear. The location where it appears still appears, and the location where it should be added still needs to be added. As if all the above configurations are invalid.
Has someone tried 'server. php? Search for confusion
Reply content:
Many web frameworks have entry files similar to index. *, while laravel is server. php. Compared with other frameworks, the server in laravel. php often appears in URLs. For example, the homepage is http: // localhost/, but when other pages are requested, the URL is changed to http: // localhost/server. php/some. I personally think this is not beautiful, and there will be some Path Problems during development.
So I want to ask if I can remove the annoying 'server. php '. The following describes the methods I have tried:
I followed the online tutorial. First, I modified httpd. conf of Apache (I used Wamp)
1. Add "RewriteEngine on" to the next line of "Listen 80"
2. removed the comments before LoadModule rewrite_module modules/mod_rewrite.so.
3. Add a new Directory (the Directory already exists in the httpd. conf file. I'm not sure if it will happen again.
Directory content:
Options Indexes FollowSymLinks
AllowOverride All
Order deny, allow
Allow from all
4. Configure. htaccess in the laravel project file (square brackets are omitted because it cannot be displayed)
IfModule mod_rewrite.c Options +FollowSymLinks RewriteEngine OnIfModuleIfModule mod_rewrite.c RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ server.php/$1 [L]IfModule
5. Add 'server' => ''to app/config/local/app. php '',
At this point, the configuration is complete, but the problem persists. 'server. php' does not disappear. The location where it appears still appears, and the location where it should be added still needs to be added. As if all the above configurations are invalid.
Has someone tried 'server. php? Search for confusion
laravelIt is best to configure the VM by yourself and direct it to index. php in public.
If you do not want to specify this parameter, check http://blog.segmentfault.com/xiaobeicn/1190000000460901.
Server. php is actually used for php built-in servers. When php-S localhost: 9999 is used to enable the built-in server, server. php is used for url compatibility.
The best deployment is also officially recommended to direct the root path to public, and the entry file is index. php.
This can also avoid some security issues.
Http://blog.csdn.net/yingdynasty/article/details/49995371
Thank you!