在vps上运用lnmp搭建php环境装置emlog博客体系,装置后在设置伪静态时发明nginx对htaccess不支持。厥后发明要在/usr/local/nginx/conf/nginx.conf手动增加相干伪静态划定规矩举行设置,emlog官方也给出了emlog在nginx下的伪静态划定规矩,增加后,emlog伪静态后的url能够一般访问了!
lnmp设置emlog伪静态:
经由过程SSH上岸putty后,输入敕令vi /usr/local/nginx/conf/nginx.conf 回车,增加emlog官方给出的伪静态划定规矩后内容以下:
123456789101112131415161718 | [[email protected] ~]# vi /usr/local/nginx/conf/nginx.conf {listen 80;server_name hapicture.com;index index.html index.htm index.php;include location.conf;root /home/www;location /{index index.php index.html;if (!-e $request_filename){rewrite ^/(.+)$ /index.php last;}}}include servers/*;} |
个中以下部份是emlog官方给出的location划定规矩
12345678 | location / {index index.php index.html;if (!-e $request_filename){ rewrite ^/(.+)$ /index.php last;}} |
增加后,按Esc退出编辑状况,然后输入:wq保留退出。
末了输入/etc/init.d/nginx restart重启nginx使设置见效。

评论列表