Discover apache rewrite http to https, include the articles, news, trends, analysis and practical advice about apache rewrite http to https on alibabacloud.com
URL rewriting this thing has been used many times in the work, but every time forget to remember to accumulate the knowledge.Hey, either think not necessary, or just don't have the time?!One, Apache articleOfficial address: http://man.chinaunix.net/newsoft/ApacheManual/mod/mod_rewrite.html1.htaccess Basic Syntax IntroductionThe server has a configuration file can not be changed by us, so in most cases, in t
First, the premise condition
This method is only applicable to Nginx Web services, the recommended installation of military LNMP or Oneinstack, the installation of their own nginx can be compiled.
Second, modify the host configuration file
Military brother Lnmp or Oneinstack configuration file in/usr/local/nginx/conf/vhost/youdomain.com.conf, add the following configuration to the file.
Server{Listen 80;Server_Name your domain name. com www. your domain name. com;
Nginx rewrite rules is very simple, if you change the rules, using the "nginx-t" command to check that the nginx.conf configuration file has a syntax error, you can try to give the condition quotation marks. For example, the Nginx rewrite rule will report a syntax error:
Rewrite ^/([0-9]{5}). html$/x.jsp?id=$1 last; the quotation marks are correct:
What is the difference between HTTP and HTTP? Seven misunderstandings about HTTPS and seven misunderstandings about httphttps
The official website of HttpWatch published a good article to clarify some misunderstandings of the HTTPS protocol.
Seven misunderstandings about HTTPS
shows that the rewrite rule of apache is changed to the rewrite rule of nginx, which is actually very simple: the rewriterule command of apache is changed to the rewrite command of nginx, the [l] Mark of apache is replaced with t
Server.xml under the Conf file in the Tomcat directory;Found itconnectiontimeout= "20000"redirectport= "8443"/>Join in the backmaxthreads= "200"Sslenabled= "true"Scheme= "https"Secure= "true"Clientauth= "false"Sslprotocol= "TLS"Keystorefile= "E:\key\m.jks" Here is the path where you generate the keyKeystorepass= "123456" Here is the password when you generate the keyKeyalias= "Alias" Here is the alias you set (remember to keep it consistent)Keystoret
Php_admin_flag engine offOrder Deny,allowDeny from allProhibit designation of User_agentRewriteengine on Rewritecond%{http_user_agent} ^*firefox/4.0* [Nc,or]Rewritecond%{http_user_agent} ^*tomato bot/1.0* [NC]Rewriterule. *-[F]Apache restricts a directory by rewriteRewriteengine on Rewritecond%{request_uri} ^.*/tmp/* [NC]Rewriterule. *-[F]This article is from the "10897714" blog, please be sure to keep this source
(forbidden). With this tag, you can link several rewriteconds to conditionally block certain URLs.gone| G (mandatory URL is deprecated gone)Forces the current URL to be obsolete, that is, immediately feedback an HTTP response code 410 (deprecated). Using this tag, you can indicate that the page has been deprecated and does not exist.proxy| P (Force agent proxy)This flag causes the replacement ingredient to be internally coerced to the proxy request a
Edit the C:windowssystem32driversetchosts file to add a field, such as 127.0.0.1 audit.localModify Apache configure files, in the XAMPP environment is under the D:/xampp/apache/conf directory, first edit the httpd.conf, open the Rewrite module: This line of comments removed: LoadModule rewrite _module modules/mod_rewri
rule changes to Nginx's rewrite rule is quite simple, if you change the rules, use the "nginx-t" command to check that the nginx.conf configuration file has syntax errors, you can try to enclose the condition with quotes. For example, the Nginx rewrite rule will report syntax errors:
Rewrite ^/([0-9]{5}). html$/x.jsp?id=$1 last; add Quotes right:
characters, () The function of parentheses is to make a mark for all characters so that they can be used later. refers to the (. *) character in front. example two: Jump to http:www.domain.cn when entering a example.com domain name Rewriteengine onRewritecond%{http_host} ^example.com [NC]Rewriterule ^ (. *) http://www.domain.cn/ [L] http://ss.kiya.cn/bbs/tread-60.html , let it continue in effect under t
-level (. htaccess) methods. To use the rewrite module, you must first install or load the rewrite module. There are two ways to install the rewrite module directly when compiling Apache. The other is to install Apache in DSO mode when compiling
Transferred from: http://www.cnblogs.com/top5/archive/2009/08/12/1544098.html1, rewrite rules introduction:The main function of Rewirte is to implement a URL jump, and its regular expression is based on the Perl language. Can be based on both server-level (httpd.conf) and directory-level (. htaccess) methods. If you want to use the rewrite module, you must first
1. Home through JS Direct jump
2. set HTTP direct to HTTPS in Apache2.2.3
1, the premise
The website has joined the OpenSSL function in Apache, and binds the tomcat (detailed operation next time writes out), may through https://+ domain name or the http://+ domain name acc
matching all URLs that do not contain newline characters, () The function of parentheses is to make a mark for all characters so that they can be used later. refers to the (. *) character in front.Example two: Jump to profile.test.com when entering a folio.test.com domain nameListen 8080Namevirtualhost 10.122.89.106:8080ServerAdmin[email protected]DocumentRoot "/usr/local/www/apache22/data1/"ServerName profile.test.comRewriteengine onRewritecond%{http_host} ^folio.test.com [NC]Rewriterule ^/(.
/(. *) http://bbs.jb51.net/$1 [r=permanent,l]
Rewritecond%{request_uri}!^/bbs/
Rewriterule ^ (. *) http://www.jb51.net/$1 [r=permanent,l]
3.Apache mod_rewrite rule Rewrite logo list
Copy Code code as follows:
1) R[=code] (Force redirect) force external redirection
Forces a URL to be redire
/standard/), use the following command to compile the so file:/Usr/local/Apache/bin/apxs-C mod_rewrite.c-lgdbmYou can get the mod_rewrite.so file.Note: "-lgdbm" is used to indicate that the gdbm link should be included when mod_rewrite.c is compiled. In this way, no "dBm fetch" error will be reported when Apache is started in step 1.
3. Now let Apache apxs Add th
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.