iis6, iis7, apache, nginx pseudo-static and 301 redirect setup (applicable to VPS cloud hosting servers)
Published: 2013-05-07
First, please remote login to the server. For how to remote, please refer to:http://www.west.cn/faq/list.asp?unid=417
This method applies towindows2003+iis6.0 systems,windows2008+iis7 you need to contact the program provider to provide the corresponding rules, and directly uploadweb.config to the website root directory,linux system apache environment directly upload.htaccess to the website root directory. For nginx environment, you need to edit the site configuration file to add redirection rules.
Pseudo-static Settings:
Windows system set via Website Assistant:
Open the Website Management Assistant, click Create Site to create. If already created, double-click the site to edit.In the pseudo-static component column, select the corresponding system. If there is no system for your program, you can select any rule and then modify and replace it with that of your own program.
win2003+iis6 environment:After enabling the setting,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 above systems:After enabling the setting, use Notepad to open, edit and modify the web.config file in the website root directory (Default: D:\wwwroot\ftp site name\wwwroot\web.config), just replace with your own rules. You can also directly upload the web.config rule file in the site directory.
Linux system settings:
Pseudo-static for Linux system + apache environment is relatively simple. Generally, program vendors directly provide .htaccess, just put it in the website root directory. The systems with our built-in environment have the rewrite module enabled by default.
Linux system + nginx environment requires referencing the pseudo-static rule file in the configuration file or adding the corresponding rule code (refer to nginx 301 settings). If unclear, you can submit a corresponding ticket for authorization and provide the rule code.
301 Settings:
For windows+iis6 environment, enable the components as described above, then add 301 redirection rules to httpd.conf:
RewriteCond %{HTTP_HOST} !^www.cctv.com$ [NC]
RewriteRule ^(.*)$ http://www.cctv.com/$1 [R=301,L]
# This rule means 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 if the visit is cctv.com, redirect to www.cctv.com; if there are multiple, copy multiple sets of rulesLinux system+apache environment implements 301 via .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, which means redirecting abc1.com and abc2.com to www.abc1.comLinux system+nginx environment needs to modify 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 nginx service
windows2008+iis7(windows2012+iis8) system implements 301 via 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, abc2.com with your own domain