i have 2 servers with 2 sub domains all of them is iis servers
1- server1.test.com (main) IIS
2- server2.test.com (backup)
i want to if the file not found on server1 change the domain to server2 and keep the whole URL
Example:
https://server1.test.com/dir1/dir2/file.pdf (when the file not found 404)
redirect it to
https://server2.test.com/dir1/dir2/file.pdf
i hope it's clear
Thanks for your help
I solved it by
i built a custom error page for error 404 in IIS by PHP to redirect from server1 to server 2
the code if it is
<?php
if ($_SERVER["HTTP_HOST"] == "server1.com") // current domain
header('Location: https://server2.com' . $_SERVER["REQUEST_URI"], TRUE, 301);
?>
then i built PHP engine in IIS from this artical
https://techexpert.tips/windows/installing-php-on-windows-server-iis/
now when server 1 send 404 error iis go to open the PHP 404 page from custom error pages and this page will re write the domain to server 2. this solution working perfectly with me
Related
I am having an issue with URL Rewrite feature on IIS running on Win Server 2019.
On that IIS, the web interface for Remote Desktop Services is running (smoothly).
I added two additional websites to the IIS, which should redirect to the "Default Web Site".
For simplicity, lets call the Web Sites like
ny-sales.domain.com
ny-saleslogin.domain.com
ny-salesmanagement.domain.com
All the ny-sales*.domain.com should redirect to ny-sales.domain.com.
So I installed the URL Rewrite module and added the rule like this:
(.*)ny-sales(login|management).domain.com(.*)
Action: Redirect
URL: https://ny-sales.domain.com/RDWeb
But somehow, I get not redirected at all, when typing https://ny-saleslogin.domain.com (or ...management...).
Can someone please help me investigate the problem?
Greetings, xola
I have a web server with IP address and port.
I would like to browse all files on this web server. How can view and upload new files there?
For example, I have already tried via a web browser:
192.168.101.190:2870
But there is an error: 404 Not Found
192.168.101.190:2870/name1.xml/r/n
403 Forbidden
I have access to the files for example: *.xml
192.168.101.190:2870/name1.xml
192.168.101.190:2870/name2.xml
Server: NFLC/3.0 UPnP/1.0 DLNADOC/1.50
The feature you're looking for is Directory Listing/Directory Browsing. If your web server is:
Apache refer to: https://wiki.apache.org/httpd/DirectoryListings#Directory_Listings
IIS refer to: https://blogs.iis.net/bills/how-to-enable-directory-browsing-with-iis7-web-config
Nginx refer to: https://nginxlibrary.com/enable-directory-listing/
I have a web application using ASP.NET 4. It displayed error below :
Mixed Content: The page at 'https://... was loaded over HTTPS, but requested an insecure script 'http://ajax.aspnetcdn.com/ajax/4.5.1/1/WebForms.js'. This request has been blocked; the content must be served over HTTPS.
It probably due to below :
But I didn't used above in the project. And I have enable CDN=true at the Script Manager as below.
How should i troubleshoot it or solve it ? Any clues ?
Thanks.
You are trying to load an insecure script (from http) over a secure context (https).
Try to load the script from https like this:
https://ajax.aspnetcdn.com/ajax/4.5.1/1/WebForms.js
I have a Zabbix server 2.2 and a few linux hosts with websites. How can I get a notification from Zabbix, if the HTTP(s) response code is not 200?
I've tried those triggers without any success:
{owncloud:web.test.rspcode[Availability of owncloud,owncloud availability].last(,10)}#200
{owncloud:web.test.error[Availability of owncloud].count(10,200)}<1
{owncloud:web.test.error[Availability of owncloud].last(#1,10)}=200
But nothing works. I never got an notification, that the code is not 200 anymore even it was 404, because I have renamed the index.php of owncloud to index2.php
I configured the Application and the we the Web Scenario as followed:
if you have already configured the host go to step 1
1) Select the host by Configuration-> Host groups -> select host (example server 1)
2) Go to Config > Hosts > [Host Created Above] > Applications and click on Create Application
3) Now you have to create the Web scenario with the status code check, in my case I checked status code 200. So go to Configuration > Hosts > [Host Created Above] > Web Scenarios and click on Create Web Scenario .
Remark: you have to select the previous application created at the step 2
4) After that without click on Add button go to Steps window and you have to configure the host and parameters for the chek. After that click on Add. In my cas e check the status code 200 response for the HTTP request.
I found the issue. You need to specify the URL to check with file. For example like this in your web scenario:
https://owncloud.example.com/index.php
"Note that Zabbix frontend uses JavaScript redirect when logging in, thus first we must log in, and only in further steps we may check for logged-in features. Additionally, the login step must use full URL to index.php file." - https://www.zabbix.com/documentation/2.4/manual/web_monitoring/example
I also used following expression as trigger:
{owncloud:web.test.fail[Availability of owncloud].last()}>0
you have set a triggers bye Expression
{host name:web.test.rspcode[Scenario name,Steps name].last()}=200
The question has been answered adequately, but I will provide a very much more advanced solution that you could use for all HTTP status codes.
I've created an item that monitors all HTTP status codes of a proxy, graphs them, and then set up multiple different types of triggers to watch last value and counts in last N minutes.
The regex I used to extract all the values from a Nginx or Apache access log is
^(\S+) (\S+) (\S+) \[([\w:\/]+\s[+\-]\d{4})\] \"(\S+)\s?(\S+)?\s?(\S+)?\" (\d{3}|-) (\d+|-)\s?\"?([^\"]*)\"?\s?\"?([^\"]*)\"?\s
I then set many triggers relevant for my particular situation
101 Switching Protocols
301 Moved Permanently
302 Redirect
304 not modified
400 Bad Request
401 Unauthorised
403 Forbidden
404 Not found
500 Server Error
It's also important that your Zabbix agent has permissions to read the log file on the host. You can add the zabbix-agent to the www-data group using this command.
$ sudo usermod -a -G www-data Zabbix
See the tutorial for all the steps in greater detail.
I have an ASP.NET MVC 2.0 application where I have an action that returns a jsonp action result. It worked on my development machine from my local IIS web site to another IIS site.
When I deployed the services site on Windows Server 2008 R2+IIS7.5 the ajax calls don't work and I get this error:
404 The resource you are looking for
might have been removed, had its name
changed, or is temporarily unavailable
Update: Solved
The problem was with query string limits on IIS 7.5. You can adjust this by following the steps on this page:
http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits
The problem was with query string limits on IIS 7.5. You can adjust this by following the steps on this page:
http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits