1、登錄wdcp后臺-系統管理-文件管理-apache(這里演示的是apache的環境,nginx的類似)如圖:
2、點擊創建文件-輸入文件名-確定如圖:
3、編輯剛創建的文件-輸入以下內容(輸入內容紅色框處修改為自己的目錄或者域名信息),然后保存如圖:
- 3-1、要么新建一個
<VirtualHost *:80> documentRoot /home/wwwroot/網站目錄名/public_html/companyServerName www.網站域名
ServerAlias *.網站域名
<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/網站目錄名:/tmp </VirtualHost> <Directory /home/wwwroot/網站目錄名> Options FollowSymlinksAllowOverride All
Order allow,deny
Allow from all
</Directory>
- 3-2、要么直接改原有的
<VirtualHost *:80> documentRoot /home/wwwroot/網站目錄名/public_html ServerName 網站域名 ServerAlias www.網站域名 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/網站目錄名/public_html/company/ ServerName www.網站域名 ServerAlias *.網站域名 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/網站目錄名> Options FollowSymlinks AllowOverride All Order allow,deny Allow from all </Directory>
- 4、如果WAP綁定了2級域名如(m.dtmuban.com)切環境為nginx,apache雙環境的服務器,主環境是 apache的
- 把nginx規則里面的 m.dtmuban.com.conf(手機版規則改成如下,以為強制轉移到apache規則)
server { listen 80; root /home/wwwroot/網站目錄/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、最后系統管理-服務重啟-web重啟,到這里就完成了,destoon網站的設置就不說了,自己按要求設置好就可以了