How do I redirect any invalid links to index.html? - glassfish

I am using grizzly glassfish to start my server. However, I cannot find a way to redirect invalid links. Any ideas?

Related

TYPO3 10.4.21 Pages accessible only via their id

Following a migration, I am trying to reconfigure TYPO3.
The backend is accessible by its url and I manage to connect. But the home page for example gives me the following error: The page did not exist or was inaccessible. Reason: No site configuration found.
All pages are not accessible by their url normally but are accessible through different query parameters, like /index.php?id=2&L=0.
I already tried to replace the .htaccess with the basic one provided by TYPO3, I also checked the Apache configuration and everything seems to be ok. I am not familiar with the TYPO3 CMS so I don't know if some of these configurations are done directly in its files. To me, it seems to be a mod_rewrite problem but I can't find it.
Someone would have a solution or at least a track to solve this problem?
As stated in the error message that you've posted it seems that the site configuration is missing. In the TYPO3 backend you can create new site configuration via Site Management => Sites.
Please check the site handling documentation for details.

Apache htaccess ErrorDocument directive not working

I found a vulnerability for content-spoofing on my webpage.
This URL:
https://www.mygreatsite.com/www.mygreatsite.com%20has%20moved%20to%20www.evilsite.com.%20CHECK%200UT%20H0W%20COOL%20THE%20NEW%20SITE%20IS!%20Sadly,%20the%20file%00
Apache Output:
Not Found
The requested URL /www.mygreatsite.com has moved to www.evilsite.com. CHECK 0UT H0W COOL THE NEW SITE IS! Sadly, the file was not found on this server.
--
The URL Overrides the Apache-Error and outputs the text added to the URL in the Browser, along with a 404-Error.
Actually, all requests to the server should be redirected to the CMS (Typo3) which in turn handles the 404-error and shows a custom page.
When I enter an URL that doesn't exist, this works perfectly. Just the above mentioned URL screws everything up.
Interestingly, when I delete the «%00» from the end of the URL, the request is forwarded to the CMS and the correct error document is displayed.
I tried to add a separate ErrorDocument-Directive to the htaccess-file - with no success.
Any ideas what goes wrong and how I could solve this?
As Anubhava points out, when a NULL-Byte is detected, Apache doesn't load any modules and just throws the 404. That's why ErrorDocument and mod_rewrite in the htaccess don't work.
[Edit for clarification]
%00 or in Hex \x00 is a NULL byte. When web server finds a NULL byte at the end then web server thinks it is a spoofing request and considers it to be dangerous to be processed by any directives.
Due to security reasons web server doesn't load any modules for this request and returns a 404 / Not found status. Browser shows default 404 page with your decoded URL just below Not Found text.

How to solve HTTPS response 498 when googlebot comes along?

I have an AJAX site leuker.nl and when googlebot comes along the site is started and it will retrieve an XML file from my backend server that contains site text.
The HTTP GET request used to retrieve the file returns a HTTP error 498.
Looking on LINK it explains that is concerns an invalid/expired token (esri) returned by "ArcGIS for Server".
I don't understand this error, I don't even use ArcGIS and never heard of it before.
Andy idea how to solve this?
In the backend I use Apache Httpd 2.4 in combination with Tomcat 8.0. Apache proxy requests to Tomcat through an ajp connector. The XML file requested is directly returned by Apache.

Mixed Content Warning with SSL on Concrete5

I have just installed a SSL certificate on my site that has concrete5 installed. I tried changing the canonical URL in the dashboard, just the SSL part to the https version of my site, and when I tried changing both it created a redirect loop so I had to undo it. The mixed content warning seems to be coming from the photos that I have on the site, Google Chrome informs me in the console that the photos and thumbnails are not using the https version, so it doesn't load them unless you specifically ask for it.
I fixed it! What I did, if anyone runs into the same problem, is I changed the Canonical URL settings in the dashboard to have the Canonical URL be the https version, the Canonical SSL URL be the https one, and have the redirect to canonical URL unchecked and it seems to be working now.

how to configure apache mod_rewrite for web services

I'm new to Apache mod_rewrite but I was able to get it to work for simple URL translation for static pages accessed using the GET method.
I'm having trouble to get the URL translation to work for web services though. Basically all I want is to redirect the request from Apache to tomcat that runs under 8093 . I tried:
RewriteRule myproject/myservices/myService/(.*) http://www.localhost:8093/myproject/myservices/myService/$1
But I get a "The document has moved here" response. Any ideas would be appreciated. Thanks.
I think the problem is that your request is only rewritten, but not proxied. You could try to append [P] at the end or look into mod_proxy: http://httpd.apache.org/docs/2.0/mod/mod_proxy.html