can't figure out what's causing a rewrite/redirect

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 11 Feb 2016, 14:43

can't figure out what's causing a rewrite/redirect

19 Dec 2016, 15:51

I'm running IIS 8.5 with ISAPI Rewrite 3.1.0.112 (licensed).

For the sake of explanation, I have a Site called test.example.edu. The default.html file at the root of this site has within it javascript that does a window.location redirect to test.example.edu/abc. There is not a .htaccess file in this Site's root folder but there is one in /abc which only removes index.php from the url. This site's binding is blank, so as to serve as the wildcard site.

I have a 2nd Site called test1.example.edu. This Site's folder only has one simple index.php file which displays the current date/time. This is not a .htaccess file in this folder. This Site's binding is set to "test1.example.edu".

The web server works, successfully serves both Sites, with the above configuration.

If I change the site bindings so that the 1st site mentioned above is set for "test.example.edu" and the 2nd site above is blank, the web server stops working. It acts like it's completely down from the browser perspective.

The weird thing, and I can't figure out why it's doing this, is that the Advanced Log for test1.example.edu in this case where it isn't working is showing that it's redirecting to D:\test1\abc which doesn't exist. Nothing for test1 should be redirecting it to /abc and I can't figure out why it's doing it. There are no URL Rewrites anywhere or files that should be doing the redirect so I'm wondering if I'm either misunderstanding some core functionality or missing a rewrite somewhere that maybe I set up too long ago to remember and can't find.

I opened up Helicon Manager and clicked on the site root for both sites above and neither shows an htaccess file.

Any ideas would be appreciated!

User avatar
Posts: 5
Joined: 11 Feb 2016, 14:43

Re: can't figure out what's causing a rewrite/redirect

19 Dec 2016, 16:40

looking in a failed request log I see this which may provide more info. how can I tell what's causing this rewrite?

Code: Select all
23.   GENERAL_REQUEST_HEADERS   Headers=""   23:41:27.105
24.   URL_CACHE_ACCESS_START   RequestURL="/abc/"   23:41:27.105
25.   URL_CACHE_ACCESS_END   PhysicalPath="", URLInfoFromCache="false", URLInfoAddedToCache="true", ErrorCode="The operation completed successfully.
 (0x0)"

105.   GENERAL_SET_REQUEST_HEADER   HeaderName="X-REWRITE-URL", HeaderValue="/abc/", Replace="true"   23:41:27.214
106.   FILTER_SET_REQ_HEADER   HeaderName="X-REWRITE-URL:", HeaderValue="/abc/"   23:41:27.214
107.   GENERAL_SET_REQUEST_HEADER   HeaderName="X-ORIGINAL-URL", HeaderValue="/abc/", Replace="true"   23:41:27.214
108.   FILTER_SET_REQ_HEADER   HeaderName="X-ORIGINAL-URL:", HeaderValue="/abc/"

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: can't figure out what's causing a rewrite/redirect

20 Dec 2016, 09:17

Hello.

As you've mentioned the redirect to /abc/ folder is done by a Javascript on your page. I suggest you take a closer look at why this script is getting executed and probably why the home page from test.example.edu is served when you expect a page from test1.example.edu. Try restarting IIS after changing bindings and try to Ctrl+Refresh the page to avoid browser cache.

User avatar
Posts: 5
Joined: 11 Feb 2016, 14:43

Re: can't figure out what's causing a rewrite/redirect

20 Dec 2016, 12:55

I've recreated the site, restarted IIS, restarted the server, opened a browser window with private/incognito mode, and it still behaves the same way.

The log shows that it's redirecting to /abc but I don't see where it shows why it's doing that.

Why does the log show this when the only redirect that should be redirecting is a javascript command?

Code: Select all
FILTER_START   FilterName="C:\Program Files\Helicon\ISAPI_Rewrite3\ISAPI_Rewrite_x64.dll"



What does this line tell us?
Code: Select all
URL_CACHE_ACCESS_START   RequestURL="/abc/"

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: can't figure out what's causing a rewrite/redirect

21 Dec 2016, 09:44

Then send complete configuration files for your sites (web.config and .htaccess) as well as complete failed request trace log. You can send it to [email protected] if you don't want to reveal details of your setup.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 14 guests