"Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL" Code Answer's
You're definitely familiar with the best coding language TypeScript that developers use to develop their projects and they get all their queries like "Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL" answered properly. Developers are finding an appropriate answer about Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL related to the TypeScript coding language. By visiting this online portal developers get answers concerning TypeScript codes question like Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL. Enter your desired code related query in the search bar and get every piece of information about TypeScript code related question on Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL.
Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL
Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL
Oracle HTTP Server - Version 12.2.1.4.0 and later
Information in this document applies to any platform.
SYMPTOMS
Using mod_rewrite configuration to change requests from non-ssl to ssl, does not work for multiple sites/virtual hosts.
Configuration works for one site but the other site is rewritten back to the first site.
The issue can be seen using the following steps:
1. Set configuration in the OHS Configuration as follows:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [R,L]
2. Start OHS.
3. Test requests.
4. Does not work as expected. It is seen that it works for one of the site definitions in a VirtualHost, but not for others.
CAUSE
Issue is expected based on configuration. There is no way to have two different global Server Names so the issue occurs sending requests to one virtual host.
The SERVER_NAME variable is set based on the configuration of ServerName Directive in the OHS configuration. Since there is one global variable, if set twice the
variable is reset. It can only be one value in relation to global/main configuration. This is why all requests are sent to the same SERVER_NAME and the issue is seen.
Reference the following document from Apache which Oracle HTTP Server is built from:
Apache HTTP Server Version 2.4
https://httpd.apache.org/docs/current/mod/mod_rewrite.html
Apache Module mod_rewrite
SOLUTION
1) Backup and modify httpd.conf or configuration where this is defined.
2) Add the following rewrite config pertaining to the different Sites/VirtualHosts:
RewriteEngine On
RewriteCond %{SERVER_PORT} xx
RewriteCond "%{HTTP_HOST}" "^xxx"
RewriteRule ^/(.*)$ https://xxx/$1 [R,L]
RewriteCond %{SERVER_PORT} yy
RewriteCond "%{HTTP_HOST}" "^yyy"
RewriteRule ^/(.*)$ https://yyy/$1 [R,L]
3) Restart OHS.
4) Test accessing respective sites.
REFERENCES
NOTE:603796.1 - How to Force HTTP Requests to be Redirected to HTTPS
All those coders who are working on the TypeScript based application and are stuck on Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL can get a collection of related answers to their query. Programmers need to enter their query on Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL related to TypeScript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL for the programmers working on TypeScript code while coding their module. Coders are also allowed to rectify already present answers of Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL while working on the TypeScript language code. Developers can add up suggestions if they deem fit any other answer relating to "Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL". Visit this developer's friendly online web community, CodeProZone, and get your queries like Using mod_rewrite Configuration to Change Requests from NON-SSL to SSL resolved professionally and stay updated to the latest TypeScript updates.