Helicon ISAPI Rewrite proxy not forwarding requests - proxy

I have the following rules defined in my helicon file:
RewriteEngine on
RewriteCond %{HTTP:Host} ^current.mydomain.com$ [NC]
RewriteRule /reg http://another.mydomain.com/registration [NC, P]
When I navigate to the URL http://current.mydomain.com/reg I just receive a blank page. It doesn't seem to be that Helicon is forwarding the request to the other site. Any ideas why?

try using the following istead:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP:Host} ^current\.mydomain\.com$ [NC]
RewriteRule ^reg http://another.mydomain.com/registration [NC,P]

Related

Force https on Windows server

I have a windows server online and some pages load in http I would like to force them to https how could I do that ?
I have no idea where to start
You will need to change the code to the following in the .htaccess file.
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
You can reffer the following blog for reference if this doesn't work.
https://www.catalyst2.com/knowledgebase/server-management/how-to-force-https-on-linux-and-windows-servers/

Redirect subdomain to Post URL

I want to redirect to my post URL when someone visits subdomain of that post name on my site.
Like this
https://www.example.com/sub/mypost ---------> https://mypost.example.com
The site is running on Apache server
So have tried some changes to a .htaccess file
Please not everything is SSL
RewriteEngine on
RewriteCond %{HTTP_HOST} https://$1.example.com [NC]
RewriteRule ^(.*)$ "https://www.example.com/sub/$1" [L,P]
It did not seem working. it redirects to Site cant be reached message on browser.
This is my previos htaccess file before changes.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Thank You.

ISAPI Rewrite - allow a subdomain to only hit a specific folder

Is there a way with ISAPI v3 to allow a subdomain to only hit a specific folder, and all other requests would redirect to www? I also have some urls under this folder that need to be rewritten. There will also be rewrite rules for valid www urls.
Allow:
http://myaccount.mysite.com/account/
http://myaccount.mysite.com/account/profile/
http://myaccount.mysite.com/account/profile/changeEmail.aspx
Allow, but needs to be rewritten:
http://myaccount.mysite.com/account/edit/123456789.aspx
These should be redirected to www:
http://myaccount.mysite.com/directory/
http://myaccount.mysite.com/folder1/
http://myaccount.mysite.com/folder1/folder2/
etc....
Try using the following:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP:Host} ^myaccount\.mysite\.com$ [NC]
RewriteRule ^account/edit/123456.aspx$ /otherpage [NC,L]
RewriteCond %{HTTP:Host} ^myaccount\.mysite\.com$ [NC]
RewriteRule ^account/.*$ - [NC,L]
RewriteCond %{HTTP:Host} ^myaccount\.mysite\.com$ [NC]
RewriteRule (.*) http://www.mysite.com/$1 [NC,R=301,L]

ISAPI Rewrite rule changing https request to http one, for specific page

What should look isapi rewrite rule which can change https to http for a specific page, ex:
https://www.portal.com/mypage to http://www.portal.com/mypage
Regards
Try using:
RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} (/mypage)
RewriteRule .? https://%1%2 [R,L]

simple 301 redirect with ISAPI_Rewrite

i need to reditrect
this url
http://www.mydomain.com/folder/Templates/ShowPage.asp?DBID=1&LNGID=1&TMID=10000&FID=579
to
http://www.mydomain.com/folder/Templates/showpage.asp?DBID=1&LNGID=1&TMID=302&FID=569
i'm using "Helicon Tech : ISAPI_Rewrite 3.0" on server 2003 iis 6
i tried
RewriteRule ^folder/templates/showpage\.asp?dbid=1&lngid=1&tmid=10000&fid=579$ /folder/templates/showpage.asp?dbid=1&lngid=1&tmid=302&fid=569 [NC,R=301,L]
Please, try using:
(You may ommit 'RewriteBase /' directive, then use '/' in front of 'folder/...')
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^DBID=1&LNGID=1&TMID=10000&FID=579$ [NC,L]
RewriteRule ^folder/Templates/ShowPage.asp$ /folder/Templates/showpage.asp?DBID=1&LNGID=1&TMID=302&FID=569? [NC,L]

Resources