redirect in IIS 6.0 - iis-6

How would I redirect requests like http://www.mydomain.com/test to the root http://www.mydomain.com in IIS 6.0
Is there any way to do this in IIS itself rather then in the code?

try to see below post that was worked for me when i had faced redirection problem
"IIS 6 how to redirect from http://example.com/* to http://www.example.com/*"

Related

IIS 8.5 Redirecting

I have a basic project running on IIS 8.5
sites
-> test.domain.com
--->virtualPath
----->index.html
On the browser when enter https://test.domain.com/virtualpath, it is return 301 (redirect) to test.domain.com/virtualpath/
I don't have any URL Rewrites in IIS configuration. Just trying to figure out why it is redirecting to test.domain.com/virtualpath/
How can avoid this 301 redirect?
The short answer is that IIS doesn't handle extensionless URLs very well. URLs are processed based on the file extension, otherwise it's presumed to be a directory you're looking to get served. The normal convention however is to omit the index.html file.
But most services like IIS take that for granted, and if nothing is specified, it will lookup if there's a /index.html.
Lets take a simple example:
google.com
In reality what's being served to you is:
google.com/index.html
Lets take your request as an example https://test.domain.com/virtualpath
test.domain.com
- virtualPath/
- index.html
As you can see, you're essentially trying to get a directory rather than a specific file. It's up to IIS to try to find and understand that you want a file instead of a directory now. That's why you're getting a 301. It's redirecting you to the /index.html file.

Cannot disable apache http->https redirection

I'm managing a Centos 7.7 server with apache 2.4 working fine so far. I hace SSL configured and running, and all my pages are served without problem (all of them through https).
Now I have to run a site which is badly coded and doesn't show correctly through https, because mixed content errors block css. The problem is that http is not working, there is a 301 Redirect to https that I'm unable to find in the configuration files. There are no Rewrites, Redirects or ProxyPass in the configuration files (grep -r Rewrite or Redirect in apache directory couldn't find anything), except this ones:
ProxyPassMatch ^/foo/(.*.php)$ fcgi://127.0.0.1:9000/mnt/data/foo/$1
ProxyPassMatch ^/foo2/(.*.php)$ fcgi://127.0.0.1:9000/mnt/data/foo2/
for using php7 only for this sites.
I have a default:443 and a default:80 VirtualHost and I cannot see anything strange.
Also I checked firewalld in case there is a Port redirection, whith no luck.
Any idea? Thanks in advance.
I solved it by myself. It turns out that firefox was doing nasty things, and clearing site preferences as pointed in
Firefox redirects to https
solved the issue.

Glassfish - Domain wise redirection to application

I am running Glassfish Server on Linux 6 for my Oracle Apex applications running on Port 8080 and 8181(for https).
now, suppose my domain is mydomain.com,
and when I access
a.mydomain.com -> it should be redirected to application 1 (i.e a.mydomain.com:8080/apex/f?p=1)
b.mydomain.com -> it should be redirected to application 2 (i.e b.mydomain.com:8080/apex/f?p=2)
and so on...
if it is hard to figure out with Glassfish, I can also move to Apache Tomcat if required.
Any advice/idea would be greatly appreciable.
I don't know Glassfish, but you might try ProxyPass inside your virtual host config
ProxyPass / http://a.mydomain.com:8080/apex/f?p=1
Similar for the b.mydomain.com domain.
If you really want a redirect, i.e. the browser's URL changes, use Redirect instead
Redirect / http://a.mydomain.com:8080/apex/f?p=1

Classic ASP enabled Windows Authentication but Request.ServerVariables(“LOGON_USER”) sometimes return wrong username

I have a classic ASP deployed in IIS 7. The Windows Authentication is enabled and every other authentication is disabled. Thus the page does not require any login, the server is able to determine the NTADMIN username.
We have an Apache rewrite in place so that the page can be accessed in an alias such as https://www-site/app/page.asp rather than accessing it like https://ntp123:8090/app/page.asp; the rewrite is like this:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/app https://%{HTTP_HOST} %{REQUEST_URI} [R,L]
ProxyPass /app http://ntp123:8090/app/
ProxyPassReverse /app http://ntp123:8090/app/
Most of the time, perhaps 99% of the time the code returns the correct "NTADMIN\user":
LoginName = Request.ServerVariables("Logon_User")
However there were several cases when the code is getting the wrong NTADMIN username. I tried to look for any similar issues via Google but most does not show the resolution.
Perhaps the ASP / IIS experts here may have the solution?
It turns out the culprit was Apache HTTP Rewrite, because from observation of the IIS logs, the client IP address is always the same, in this case the Apache Server. It looks like it either has some caching issue or it's just not compatible with IIS's windows authentication. Either way, by removing this, the issue is no longer encountered.

wamp https vhost domain redirects to localhost https

I have setup WAMP on C:\wamp, I followed a tutorial guide to setup HTTPS on my wamp. made ssl with openssl.. I was able to browse https://localhost as well as http://localhost, the problem is, I have set a couple of virtual host domains in httpd-vhost.conf I can browse them normally as in without https BUT when I enter **https**://domain.local it redirects to WAMP **https**://localhost
I simply can't seem to fix it or get a solution online.. what settings could be causing to redirect to https://localhost instead of https://domain.local
I think the problem is in var/wamp/www/yourproject/shared/config/config.php.
Find ('K_REDIRECT_LOGIN_MODE', 4) and change 4 to 3 (html redirect).