ARR and url rewrite to route to localhost app in IIS webserver - url-rewriting

I have used ARR and URL rewrite to reverse proxy request from the internet to my local host MVC web app.
The weird thing is some parts of the web app works while others show 404 err:
1) When I type in : mywebsite/Nodewebsite/ - that works
2) When I type in : mywebsite/Nodewebsite/blog - that works
3) When I type in : mywebsite/Nodewebsite/admin - I get my admin page fine but when I try to log on I get a 404 err.
4) When I click on a link on lets say : mywebsite/Nodewebsite/blog that points to another page in my web app, I get a 404 err.
I checked the URL, the path is not right in the 404 err, it points to a location in my web root folder.
It seems whenever I try to access the web app from the internet by typing in a specific URL, it will work but if something redirect to a site it gives a 404 err.

Related

Weblogic 12.2 + url rewriting = response blocked

I have to refresh an old webapp and i'm facing a problem i can't find...
Old situation :
webapp (Java6, wicket) on Weblogic 10.3, external access via URL rewrite by IIS
everything OK
New situation :
refreshed webapp on WL 12.2, IIS unchanged.
Results : Inside URLs : everything OK
Outside URLs : HTTP 200 OK, but all pages HTTP 302 (redirections) fails
browser receive 503 (unavailable) after a while.
I looked at the logs :
WL12 : process OK, response 302 found, location:inside URL
IIS : found code 400
I looked at [Oracle docs][1], i saw that they added CSRF protection, i believed it could be that, i disabled it, but nothing changed.
Any idea ?
Thanks in advance.
[1]: https://docs.oracle.com/middleware/12213/wls/WBAPP/weblogic_xml.htm#WBAPP-GUID-E3A9B2FC-E098-43B1-ACFF-4A457D6062DE search for "referer-validation"
Forget that.
The WL12 was installed on an "end of life" server running HP Unix.
I deployed the same app on WL12 on redhat, it worked as intended.

TYPO3 - HTTPS Migration

I'm running a website under TYPO3 6.2 and follow this tutorial in order to migrate my website on HTTPS. For now I got success with :
following typoscript configuration on the root page :
config.absRefPrefix = auto
config.baseURL >
following TSconfig on the root page :
TCAdefaults.pages.url_scheme = 2
.. and everything seem to work fine. But if I edit this parameter :
... website shuts down with infinite redirection loop (301 Moved Permanently). Why ? The result is the same (infinite loop) if I execute this query :
UPDATE pages SET url_scheme = 2
...and same for BE if I make this change :
$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] = ‘2’;
You should not use the url_scheme field exactly because of issues like these. In fact this field was dropped with TYPO3v8. Any Page TSConfig related to url_scheme should be removed and you should run an SQL query to fix all existing pages.
Instead you should enforce HTTPS using a redirect in your .htaccess.
Infinite loops like these are usually caused by redirects performed both by TYPO3 and your webserver:
You request the site with HTTP.
TYPO3 redirects to HTTPS
Your webserver redirects to HTTP
Repeat 2. and 3.
For this reason you should also check your existing redirects, e.g. for enforcing www. in your domain.

IIS 7 - CodeIgniter Application name error 404 if not in correct case

I host my CodeIgniter website under IIS 7 with application name NewApp. So the URL can be reach on URL "my-domain.com/NewApp". The landing page can be access through "my-domain.com/newapp" link. But when I tried to access the other page like "my-domain.com/NewApp/Module" using "my-domain.com/newapp/Module" URL format, it gave me 404 error.
I have tried to un-tick the "ignore case" under "URL Rewrite" section but it makes "my-domain.com/newapp/Module" accessible and "my-domain.com/NewApp/Module" error 404.
Here is the setting that I applied on the IIS "URL Rewrite" section
Update Aug 12, 2015
The working application name is depend on what URL that we accessed after IIS Application Pool recycle period. So if I access "newapp" after the recycle period, we cannot access "NewApp". The same behaviour also applied when I access "NewApp" at the first time.
I found out that if I call codeigniter function $this->uri->uri_string() on "newapp" (assume I run "NewApp" after recycle period) the string that returned by the function is "NewApp/Controller/Function". And if I call the same function on "NewApp" it will returned "Controller/Function"
The temporary solution is to modify the router core class to make the function return the same output string.
Is there anyone know what to do in IIS so I don't use this temporary solution?

CodeIgniter returns 404 for all routes but works

I have strange problem with CodeIgniter and routing system and can't find solution for it, so: I have several routes such as
'forum/(:num)'
=> 'forum/category/$1',
'forum/(:num)/(page:any)'
=> 'forum/category/$1/$2',
and them works, but return 404 code in header.
I mean I don't get 404 page, correct HTML returns and page's content displays correctly for my forum's categories. But I'm getting 404 in header (Network tab in Firebug), so I can't work with POST data correctly.
If I request /forum/ - 200 Ok returns, but when I trying to get routed page, I get right page, but with 404 Not Found.
I'm using PHP5.4+Apache2 on Linux host, if it will help You to give me solution.
I've found solution! Maybe it will save someone's time.
Problem wasn't in CodeIgniter, I've found solution in activation mod_rewrite. Yes, that worked, but wan't activated in Apache.
Just try to do
sudo a2enmod rewrite
and restart apache service after
sudo service apache restart
And all routed pages will return 200 Ok
None of these worked, but I did this instead:
At the end of my controller I put this:
$this->output->set_status_header('200');
and actually though that worked, the problem turned out to be a controller name that conflicted with a real directory name...

IIIS 7.5 URL rewrite to Geoserver giving Connection Reset error

I have Geoserver set up on a Windows 2008 server using Jetty as the web container on port 8080. If the browse to http://[servername]:8080/geoserver/www/test/test.html I get a html page returned as expected.
Then I have set up IIS 7.5 using ARR and URL rewrite at the application pool level, to set up a reserve proxy. So that http://[servername]/geoserver.. is rewritten to http://[servername]:8080/geoserver... I am using match '.*' for the url and 'geoserver/' for the condition.
This gives a error when browsed to of 'connection reset' IIS http error log (C:\Windows\System32\LogFiles\HTTPERR) shows 'Connection_Dropped DefaultAppPool'
If I change the url rewrite to an action of redirect, the html page is displayed as expect, but obviously the url shows as redirected to port 8080.
Solved this by changing the URL rewrite to use .* for the URL match condition.

Resources