王尘宇王尘宇

研究百度干SEO做推广变成一个被互联网搞的人

vps lnmp安装包 nginx设置emlog伪静态

在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使设置见效。


相关文章

评论列表

发表评论:
验证码

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。