www.rusroute.com

RusRoute firewall forum
It is currently Sat Jun 24, 2017 3:10 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Feb 25, 2013 4:52 pm 
Offline

Joined: Sun Aug 24, 2008 7:15 am
Posts: 26
If it's possible I also want to redirect specific websites to their https version.
Currently I'm trying to do so by using HTTP cache with Custom URLs and
Subst by resource file
------------301.txt-----------
Code:
HTTP/1.1 301 Moved Permanently
Date: %
Server: RusRoute
Cache-Control: no-cache
Location: https://{DOMAIN}/{URL}
Content-Type: text/html
Content-Length: %


But this doesn't redirect the page and {DOMAIN} or {URL} doesn't translates to respective data.
I'll very much appreciate if you can help me with this, or advice any other way to accomplish the task. Thank you for taking the time to read the e-mail.
Kind regards,


Top
   
PostPosted: Mon Feb 25, 2013 4:55 pm 
Offline

Joined: Sun Aug 24, 2008 7:15 am
Posts: 26
Tested and worked:

Attachment:
File comment: Html page with macros for RusRoute with JavaScript redirects.
200-Test.zip [521 Bytes]
Downloaded 1954 times


Hello, !

It is not possible in the current version of RusRoute to make redirects
from http web sites to https sites using RusRoute macros in redirects.
I thiking if to add such possibility in the new versions.
But you can now do your task using substitution with macros to a "HTTP/1.1
200 OK" pages using Javascript handler to parse "{URL}" or "REQUEST_URI"
macros and go to new https url.
For example, try something like

Code:
HTTP/1.1 200 OK
Date: %
Server: RusRoute
Cache-Control: no-cache
Content-Type: text/html
Content-Length: %

<html>
<head>
<title>Redirecting to https site ...</title>
</head>
<body>
<h3>Redirecting to https site ...</h3>
<script type="text/javascript" language="JavaScript">
function goto_url(u)
{
 if (window.top != window.window)
 {
  window.top.location.href = u;
 }
 else
 {
  window.location.href=u;
 }
}

var src_url="{URL}";
var dst_url;
if (src_url.substr(0, 7) == "http://")
{
    dst_url = "https://" + src_url.substr(7, src_url.length - 7);
    goto_url(dst_url);
}
else
{
    document.write("<pre>Error parsing url " + src_url + " </pre>");
}
</script>
</body>
</html>


Top
   
PostPosted: Fri May 31, 2013 8:56 am 
Offline

Joined: Sun Aug 24, 2008 7:15 am
Posts: 26
Are you still using RusRoute? Are there suggestions to advice it?

There are new macros in RusRoute 1.8.7: {HTTPDOMAIN} and {HTTPURLPATH}. They are allowing to make 301/302 HTTP to HTTPS redirect not using JavaScript.
The subst file example:
Attachment:
302https.rar [550 Bytes]
Downloaded 1656 times


------------
HTTP/1.1 302 Moved Temporarily
Date: %
Server: RusRoute
Cache-Control: no-cache
Location: https://{HTTPDOMAIN}{HTTPURLPATH}
Content-Type: text/html
Content-Length: %

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>302 Moved Temporarily</title>
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
</head>

<body bgcolor="#FFFFFF">

<h1>302 Moved Temporarily</h1><br><br>

<font face="MS Sans Serif" size="2">
The document has moved <A HREF="https://{HTTPDOMAIN}{HTTPURLPATH}">here</A>.
</font>

<br><br>
<hr>
<em>RusRoute firewall WebServer v1.0 (Win32/Win64)&nbsp;&nbsp;Website&nbsp;<a href="http://www.rusroute.ru/">RusRoute</a></em>
</body>
</html>
------------


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited