How to make the Linux host open pseudo-static

  

Many Linux-type hosts in China do not open .htaccess by default, which leads to the lack of support for pseudo-static. Foreign virtual hosts basically support this service.

Many webmasters simply think that .htaccess is pseudo-static, using .htaccess as a pseudo-static synonym, thinking that .htaccess plays the role of .htaccess, but its role is much larger than you think. , out of pseudo-static, as well as our well-known 404, 301 jump, etc., can be achieved through .htaccess, let me introduce how to open the .htaccess support under the Linux host, you have this Permissions, generally this is for servers or VPS, virtual hosting is basically no way, unless you ask the provider to help you open. Another situation is that some children's shoes use this method when building PHP
+MySQL+Apache locally. The local one-click installation package has xampp and phpnow, etc. I personally recommend using phpnow, easy to use. , completely foolish. If you use phpnow to build it, you don't have to look down, because the default is turned on.

The method is as follows:


First: find httpd.conf in the conf folder under the Apache folder, notepad or similar editing tool after opening Ctrl+ F find "LoadModule rewrite_module", find the line where "LoadModule rewrite_module modules /mod_rewrite.so" is located, make sure that there is no # in front of this line, it means that the pseudo-static module has been loaded, if there is # in front of this line, please remove it. After phpnow is installed, there is no # by default.


Second: Let the Apache server support .htaccess, how to make your own local Apache server support?.htaccess”? In fact, simply modify the httpd.conf settings of apache. Let support .htaccess. Open the httpd.conf file and open it with a text editor. Find


Options FollowSymLinks

AllowOverride None


Change to

Options FollowSymLinks

AllowOverride All


The first is to determine if a pseudo-static module has been loaded, and the second is to modify the settings here. After the operation, test whether .htaccess has taken effect. If it is not yet valid, please restart the Apache service.

Copyright © Windows knowledge All Rights Reserved