iis6, iis7, apache, nginx pseudo-static and 301 redirect setup (applicable to VPS cloud hosting servers)
Published: 2013-05-07
First, please log in to the server remotely. For how to connect remotely, please refer to:http://www.west.cn/faq/list.asp?unid=417
This method applies to windows2003+iis6.0 systems. For windows2008+iis7, you need to contact the program provider to provide the corresponding rules, and directly upload web.config to the website root directory. For the linux system apache environment, directly upload .htaccess to the website root directory. For the nginx environment, you need to edit the site configuration file to add redirect rules.
Pseudo-static settings:
windows system settings through the Website Assistant:
Open the Website Management Assistant and click Create Site to create one. If it has already been created, double-click the site to edit it.In the Pseudo-static Components column, select the corresponding system. If your program system is not listed, you can select any rule and then modify and replace it with your own program's rule.
win2003+iis6 environment:After the setting is enabled, use Notepad to open, edit, and modify httpd.conf in the others directory of the website directory, (default: D:\wwwroot\ftp-site-name\others\httpd.conf).Note that the top two lines in httpd.conf cannot be replaced; just replace the rules with your own.

Some common system rules:http://www.west.cn/faq/list.asp?unid=520
win2008 and later systems:After the setting is enabled, use Notepad to open, edit, and modify the web.config file under the website root directory (default: D:\wwwroot\ftp-site-name\wwwroot\web.config), and replace it with your own rules. You can also directly upload the web.config rule file to the site directory.
linux system settings:
The pseudo-static setup for the Linux system + apache environment is relatively simple. Generally, program vendors directly provide .htaccess; just place it in the website root directory. The systems in our built-in environment have the rewrite module enabled by default.
For the Linux system + ngix environment, you need to reference the pseudo-static rule file in the configuration file or add the corresponding rule code (refer to nginx 301 settings). If it is unclear, you can submit a corresponding ticket for authorization and provide the rule code.
301 settings:
For the windows+iis6 environment, enable the components according to the above method, then add 301 redirect rules to httpd.conf:
RewriteCond %{HTTP_HOST} !^www.cctv.com$ [NC]
RewriteRule ^(.*)$ http://www.cctv.com/$1 [R=301,L]
#This rule means that all domains on the site are 301 redirected to www.cctv.com
RewriteCond %{HTTP_HOST} ^cctv.com$ [NC]
RewriteRule ^(.*)$ http://www.cctv.com/$1 [R=301,L]
#This rule means that if the visit is cctv.com, it redirects to www.cctv.com. If there are multiple, copy multiple sets of rulesLinux system + apache environment implements 301 through .htaccess:
Copy the following rules into Notepad, save as .htaccess, and upload to the website root directory.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc1.com$ [NC,OR]
RewriteRule ^(.*)$ http://www.cctv.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^abc2.com$ [NC]
RewriteRule ^(.*)$ http://www.cctv.com/$1 [R=301,L]
</IfModule>
# Replace with your own domain in RewriteCond, indicating that abc1.com and abc2.com are redirected to www.abc1.comLinux system + nginx environment requires modifying the site configuration file to implement 301:
Add the following rules to the site configuration file server{......}
server{
...
if ($host ~* cctv.com) {
rewrite ^/(.*)$ http://www.cctv.com/$1 permanent;
}
...
}
# After saving, reload or restart the nginx service
windows2008+iis7(windows2012+iis8) system implements 301 through web.config
Copy the following rules into Notepad, save as web.config, and upload to the website root directory.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="301Redirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^abc1.com$" />
<add input="{HTTP_HOST}" pattern="^abc2.com$" />
</conditions>
<action type="Redirect" url="http://www.abc1.com/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
# Replace abc1.com and abc2.com with your own domains