资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

wordpress配置 wordpress配置https域名

wordpress重定向及nginx配置

location / {

创新互联建站专注于淮上网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供淮上营销型网站建设,淮上网站制作、淮上网页设计、淮上网站官网定制、成都微信小程序服务,打造淮上网络公司原创品牌,更为您提供淮上网站排名全网营销落地服务。

index index.html index.php;

if (-f $request_filename/index.html){

rewrite (.*) $1/index.html break;

}

if (-f $request_filename/index.php){

rewrite (.*) $1/index.php;

}

if (!-f $request_filename){

rewrite (.*) /index.php;

}

}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

1. 在阿里云或其他地方申请证书文件得到如:

214040226730432.key  214040226730432.pem

放到如  /etc/nginx/cert目录下

2.nginx配置文件里面

server {

listen 443;

server_name jadewen.win ;

ssl on;

root /var/www/default;

index index.php index.html;

ssl_certificate  cert/214040226730432.pem;

ssl_certificate_key  cert/214040226730432.key;

ssl_session_timeout 5m;

ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_prefer_server_ciphers on;

location / {

  try_files $uri $uri/ /index.php?$query_string;

}

  location ~ \.php$ {

  fastcgi_pass 127.0.0.1:9000;

  fastcgi_index index.php;

  include fastcgi.conf;

}

}

3.重定向http到https

server {

listen        80;

server_name  jadewen.win ;

return 301    ;

}

配置多个server块映射到不同目录即可,但是免费的https证书只能支持一个主域名,二级域名仍然只能是http的

server {

listen        80;

server_name  blog.jadewen.win;

root          /var/www/blog;

index        index.php index.html;

location / {

try_files $uri $uri/ /index.php?$query_string;

}

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

include fastcgi.conf;

}

}

怎样配置wordpress

首先需要在配置httpd.conf以启用url rewrite功能:

将#LoadModule rewrite_module modules/mod_rewrite.so前面的注销去掉然后重启apache,在命令行使用httpd -M查看当前模块情况.如有rewrite_module(shared)说明模块已经成功加载.

配置目录的allowoverwrite属性:

在Apache 2.x 中,我们会看到 DocumentRoot设置的一行。这行就是存放网页程序的地方。比如存放在 c:/www 目录中,那么我们就要设置 DocumentRoot为如下的:

DocumentRoot "c:/www"

然后我们再还要对 DocumentRoot做针对性的行为设置。在一般的情况下,httpd.conf 会给一个默认的。如果你要改 DocumentRoot的路径,同时也要改针对DocumentRoot的Directory的设置,也就是

Directory "DocumentRoot中设置的路径"

比如我们把DocumentRoot的路径改为了 “c:/www”,那我们也要把 DocumentRoot做针对性的行为设置也要改成这个路径.

注意不要修改一下default的配置

Directory /

Options FollowSymLinks

AllowOverride None

Order deny,allow

Deny from all

/Directory

而是修改这里:

Directory “c:/www”

#

# Possible values for the Options directive are “None”, “All”,

# or any combination of:

# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

#

# Note that “MultiViews” must be named *explicitly* — “Options All”

# doesn’t give it to you.

#

# The Options directive is both complicated and important. Please see

#

# for more information.

#

Options Indexes FollowSymLinks

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be “All”, “None”, or any combination of the keywords:

# Options FileInfo AuthConfig Limit

#

AllowOverride All

#

# Controls who can get stuff from this server.

#

Order allow,deny

Allow from all

/Directory

把AllowOverride 的参数设置为ALL,表示整台服务器上的,都支持URL规则重写。Apache 服务器要读每个网站下的家目录下的 .htaccess 文件。如果没有这个文件,或者这个文档没有定义任何关于URL重写的规则,则不会有任何效果。在一般的情况下,成熟的Web 服务器应用套件,都支持URL重写的,比如drupal和joomla 。当我们用这些程序时,会发现在安装包中有 .htaccess中有这个文件。我们把Apache配置好后,只是需要在这些程序的后台打开此功能就行了.

下面是WordPress安装包中的.htaccess文件

# BEGIN WordPress

IfModule mod_rewrite.c

RewriteEngine On

RewriteBase /wordpress/

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /wordpress/index.php [L]

/IfModule

# END WordPress

如何配置wordpress网站

设置wordpress分3块。

1、wordpress的常规设置。

2、wordpress的固定链接设置。

3、wordpress的阅读设置。

一般新站,首先经过这3个设置,以便后期维护及使用,不懂追问。


网页题目:wordpress配置 wordpress配置https域名
本文来源:http://cdkjz.cn/article/ddedgsg.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220