1. Add configuration in Web. config 2. Create a new Class library project under the current solution3, a new CS, named: Domain301.csUsing system;using system.web;using system.configuration;namespace domain{public class Redirectnewdomain:ihttpmodule {public void Dispose () {} public void Init (HttpApplication context) { Context. AuthorizeRequest + = (new EventHandler (Process301)); } public void Process301 (object sender, EventArgs e) {HttpApplication app = (HttpApplication) se
Believe that a lot of webmaster friends have such problems appear. That is, the domain name with the WWW prefix and the top-level domain name without the WWW prefix are different. This problem is mainly due to the search engine for the top-level domain name and two-level domain name weight difference caused.There is no doubt that the only domain name can bring you more benefits. Whether it is with the WWW or not with www. Because, so whether the user or search engine will remember your site's un
willing to do it for you. So I want to start with the program. I am using the wordpress blog program. This program is quite good for SEO. I believe that you will also encounter such problems at ordinary times, especially targeting www-free domain names, because I have been familiar with PHP before, so it is quite easy to do it.
1. Relatively simple 301 redirection of domain names: to
LNMP Nginx If you want to redirect domain name 111cn.net 301 to Www.111cn.net, and Www.111cn.net has been added through Lnmp vhost Add,
You can modify the following steps.
Edit the corresponding virtual host configuration file, the general virtual host configuration file is located in:/usr/local/nginx/conf/vhost/domain name. conf, such as the added domain name is www.111cn.net
The configuration file is/u
engine bounce rateBounce Rate: Users come to your site and only browse a page to leave the percentage.Thinking: What are the impact on site rankings? The principle of fast-line technology.3 , where is the site navigation? What role does it have? Example:http://www.wycszx.com/ Hefei registered company Hefei Company Registration Hefei Company in Hefei Agent Company Registration Promotion keyword Density blend usehttp://www.tuniu.com/ Weight 7 The category page promotes weights.Thinking: How to
Demand:If you do not have this URL locally rewrite to another server to request;Realize:server {listen 8080;if (!-e $request _filename) {rewrite ^/(. *) $http://192.168.2.42/$ permanent;}}DescriptionWhen there is no such resource on the local web, jump to the 192.168.2.42 server to request;This article is from the "Shine_forever blog" blog, make sure to keep this source http://shineforever.blog.51cto.com/1429204/1619796Use Nginx 301
The use of 301 redirect can be without the WWW domain name to the WWW domain name, so that the weight can be all pointed to the domain name with www, the site optimization is very helpful.
http://www. " server_name Else Response.AddHeader "Location", "http://www." server_namepath_infostrquery_stringstr End If Response.End End If%>
Friends who use ASP.net and follow the new technology may already know that the Response.redirectpermanent () method has been added in ASP.net 4.0 to achieve permanent redirection, and the effect of the method is clearly explained in the annotation: execution from the requested URL to the specified A permanent redirection of URLs and provides options for completing the response.
In the ASP.net MVC 3 project, we can use the following notation to implement permanent redirection as needed:
expression to the Nginx conf file.
—————————————————–
Location/{
Put it here.
}
—————————————————-
Complete configuration:
This is my complete wordpress nginx rewrite rule configuration.
1, nginx rewrite URL change 301 redirect.
2, Nginx rewrite iamle.cn redirect to Www.jb51.net.
3, nginx
Set WordPress 301 redirection for Nginx on CentOS Server
In the Nginx environment, use 301 for permanent redirection. The code is:
Rewrite ^/archives/(. *)/$1 permanent;
You can also write data separately, for example:
Rewrite ^/archive/(%0-9%%%%%.html $/%1.html permanent; # rewrite ^/archive/category /(. *) $/category/$1 permanent; # directory category rewri
Today, I suddenly found that a problem occurred when I used snoopy to remotely retrieve wordpress content: print $ snoopy- gt; results and found 301 MovedPermanently. After continuous debugging, find if (! Empty ($ this- gt; port) $ headers. q
Today, I suddenly found that a problem occurred when I used snoopy to remotely retrieve wordpress content: print $ snoo
The current WordPress fixed link format is/% Category %/% year %-% monthnum %-% day %/Your postname).html
ChangeArticle/% postname %/
How to write the 301 redirection rule in htaccess?
I have a stupid idea here. I don't know if this is feasible.I have exported all the current addresses of all the articles.Can I add rules in htaccess to direct all these links to the corresponding new link?
For exampleThe
.}------------------Complete the Configuration:
This is my complete WordPress nginx rewrite rule configuration.1. Change the nginx rewrite url to 301 redirection.2. nginx rewrite iamle.cn is redirected to www.jb51.net.3. nginx WordPress rewrite pseudo-static rules (support for WordPress custom URLs ).
Copy codeThe Code
ArticleDirectory
2. For Windows hosts, you can use PHP to jump (the method is from the Internet)
1. Linux host, which is the simplest. Modify. htaccess
Modify the WordPress Part Of The. htaccess file as follows:
#Begin WordPressOptions+Followsymlinksrewriteengine onrewritecond% {Http_host} ^ www. Old.COM [Nc] rewriterule^ (. *) $ Http://Www.new.com/#1 [L, r = 301]#End
Today, I want to realize through WordPressHttp://hcsem.com/a?h-1Pseudo-Static isHttp://hcsem.com/a-1.htmlFind a lot of information, finally fix.Just add the following code to the functions.php file:Add_filter (' Rewrite_rules_array ', ' my_insert_rewrite_rules '); Add_filter (' Query_vars ', ' my_insert_query_vars '); Add_action (' wp_loaded ', ' my_flush_rules ' );//Flush_rules () If our Rules is not yet includedfunctionMy_flush_rules () {$rules= Get_option (' Rewrite_rules ' ); if( !isset($rul
%//%year%/%monthnum%/%postname%//%year%/%monthnum%/%day%/%postname%.html/%year%/%monthnum%/%postname%.html/%category%/%postname%.html/%post_id%.htmlFor example, my blog the previous fixed-link format is:/%year%/%monthnum%/%postname%/ , now changed to:/%post_id%.html if changed after the visit to the article 404, You can check whether the host under the Web site supports pseudo-static, which is the site root directory under the Apache environment . htaccess file 650) this.width=650; "src=" Http:/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.