1、登錄wdcp后臺(tái)-系統(tǒng)管理-文件管理-apache(這里演示的是apache的環(huán)境,nginx的類似)如圖:
2、點(diǎn)擊創(chuàng)建文件-輸入文件名-確定如圖:
3、編輯剛創(chuàng)建的文件-輸入以下內(nèi)容(輸入內(nèi)容紅色框處修改為自己的目錄或者域名信息),然后保存如圖:
- 3-1、要么新建一個(gè)
<VirtualHost *:80> documentRoot /home/wwwroot/網(wǎng)站目錄名/public_html/companyServerName www.網(wǎng)站域名
ServerAlias *.網(wǎng)站域名
<IfModule mod_rewrite.c>RewriteEngine On
Errordocument 404 /404.phpRewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.php
RewriteRule ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3
</IfModule> php_admin_value open_basedir /home/wwwroot/網(wǎng)站目錄名:/tmp </VirtualHost> <Directory /home/wwwroot/網(wǎng)站目錄名> Options FollowSymlinksAllowOverride All
Order allow,deny
Allow from all
</Directory>
- 3-2、要么直接改原有的
<VirtualHost *:80> documentRoot /home/wwwroot/網(wǎng)站目錄名/public_html ServerName 網(wǎng)站域名 ServerAlias www.網(wǎng)站域名 Errordocument 400 /errpage/400.html Errordocument 403 /errpage/403.html Errordocument 404 /errpage/404.html php_admin_value open_basedir /www/web/minzuqiye:/tmp<IfModule mod_deflate.c>
DeflateCompressionLevel 7 AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php AddOutputFilter DEFLATE css js html htm gif jpg png bmp php </IfModule> </VirtualHost> <VirtualHost *:80> documentRoot /home/wwwroot/網(wǎng)站目錄名/public_html/company/ ServerName www.網(wǎng)站域名 ServerAlias *.網(wǎng)站域名 RewriteEngine On Errordocument 404 /404.php RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.php RewriteRule ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3 </VirtualHost> <Directory /home/wwwroot/網(wǎng)站目錄名> Options FollowSymlinks AllowOverride All Order allow,deny Allow from all </Directory>
- 4、如果WAP綁定了2級(jí)域名如(m.dtmuban.com)切環(huán)境為nginx,apache雙環(huán)境的服務(wù)器,主環(huán)境是 apache的
- 把nginx規(guī)則里面的 m.dtmuban.com.conf(手機(jī)版規(guī)則改成如下,以為強(qiáng)制轉(zhuǎn)移到apache規(guī)則)
server { listen 80; root /home/wwwroot/網(wǎng)站目錄/public_html/mobile; server_name m.dtmuban.com; index index.html index.php index.htm; error_page 400 /errpage/400.html; error_page 403 /errpage/403.html; error_page 404 /errpage/404.html; error_page 405 /errpage/405.html; error_page 503 /errpage/503.html; location ~ \.php$ { proxy_pass https://127.0.0.1:88; include naproxy.conf; } location ~ /\.ht {deny all;
}
location / { try_files $uri @apache; } location @apache { internal; proxy_pass https://127.0.0.1:88; include naproxy.conf; } }
5、最后系統(tǒng)管理-服務(wù)重啟-web重啟,到這里就完成了,destoon網(wǎng)站的設(shè)置就不說(shuō)了,自己按要求設(shè)置好就可以了