Many web frameworks have index.*-like entry files, while in Laravel they are server.php. The server.php in Laravel often appears in URLs compared to other frameworks, such as: The home page is http://localhost/, but when other pages are requested, the URL becomes http://localhost/server.php/some. Personally feel that this is not beautiful, development will encounter some path problems.
So I would like to ask if there is no way to remove the annoying ' server.php '. Here's the way I tried it:
I am following the online tutorial, first I modified the Apache httpd.conf (I use Wamp)
1, the next line of "Listen 80" adds "Rewriteengine on"
2, remove the LoadModule rewrite_module modules/mod_rewrite.so in front of the comments
3, add a new directory (directory already exists in the httpd.conf file, I'm not sure if it will be okay
Directory content:
Options Indexes FollowSymLinks
AllowOverride All
Order Deny,allow
Allow from all
4. Configure the. htaccess in the Laravel project file (the brackets are omitted because they 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 ' = ' in app/config/local/app.php,
Here, the configuration is complete, but the problem is still, ' server.php ' does not disappear, the place where it appears, the addition of the place to add. As if all of the above configurations are invalid.
Has anyone tried to get rid of ' server.php '? Ask for doubts
Reply content:
Many web frameworks have index.*-like entry files, while in Laravel they are server.php. The server.php in Laravel often appears in URLs compared to other frameworks, such as: The home page is http://localhost/, but when other pages are requested, the URL becomes http://localhost/server.php/some. Personally feel that this is not beautiful, development will encounter some path problems.
So I would like to ask if there is no way to remove the annoying ' server.php '. Here's the way I tried it:
I am following the online tutorial, first I modified the Apache httpd.conf (I use Wamp)
1, the next line of "Listen 80" adds "Rewriteengine on"
2, remove the LoadModule rewrite_module modules/mod_rewrite.so in front of the comments
3, add a new directory (directory already exists in the httpd.conf file, I'm not sure if it will be okay
Directory content:
Options Indexes FollowSymLinks
AllowOverride All
Order Deny,allow
Allow from all
4. Configure the. htaccess in the Laravel project file (the brackets are omitted because they 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 ' = ' in app/config/local/app.php,
Here, the configuration is complete, but the problem is still, ' server.php ' does not disappear, the place where it appears, the addition of the place to add. As if all of the above configurations are invalid.
Has anyone tried to get rid of ' server.php '? Ask for doubts
laravel
It is best to configure the virtual host itself, pointing directly to the index.php in the public
If you do not specify, you can look at this http://blog.segmentfault.com/xiaobeicn/1190000000460901.
Server.php is actually for PHP built-in server used when using Php-s localhost:9999 to open the built-in server will use server.php do a part of the URL-compatible work
The best deployment is also the official recommendation is to point the root path to public, the portal file is index.php
This can also avoid some security issues
http://blog.csdn.net/yingdynasty/article/details/49995371
No Sheha haha