URL for rewrite "Open html page without the .html extension" - url-rewriting

My website with the URL1 "https://domain/#/home.html" gives
Error 404: Page Not Found
whereas the URL2 "https://domain/#/home" works as expected.
If I want to reach URL2 from URL1, I know that a change in webserver setting might just be enough.
Despite several unsuccessful attempts to get this done by simply defining a rule within the IBM HTTP Server httpd conf, I wander if mod_rewrite httpd config parameter change is what all I need to look into. Or it's anything else that can solve my purpose.

Related

Supabase Add additional redirect URL not working

I'm trying to set up auth in supabase
Following the tutorial, I try adding domain 'io.supabase.flutterquickstart://login-callback/'
but nothing happens. Maybe this is a bug in the software, not sure
I already commented on the Github issue but for reference here as well:
Maybe a hint because I tripped over this twice now in 3 days. Make sure you have a slash at the end of the URL in the additional Redirect URLs and check the API call sent to supabase to compare.
My problem was that the first localhost address works, but the second doesn't because of the missing slash. If it doesn't find the exact URL, it defaults to the "Site URL" address:

Prevent apache from replacing fully qualified server name with localhost?

I have installed MAMP on High Sierra, on myserver.mycollege.edu
If I point my browser (chrome) to http://myserver.mycollege.edu/some/path, what shows up in the address bar is localhost/some/path.
And if some/path/index.html contains a link to myserver.mycollege.edu/some/other/page, that gets replaced with localhost/some/other/page
This happens for other users, when accessing my content from their own machine! This obviously fails because their browser is now trying to access a web server on their own machine instead of mine.
So my question is, what is responsible for this URL rewrite, and how do I stop it?
One thing I should have mentioned is that some/path is mediawiki-1.28.1.
The top page served out of that directory is index.php, which will do some config things as part of serving its top level page.
localhost was actually hard coded in LocalSettings.php:
The protocol and server name to use in fully-qualified URLs
$wgServer = "http://localhost";
Replacing with myserver.mycollege.edu fixed the problem.

Using CasperJS to log insecure resource errors on https pages

With CasperJS, I would like to add some test coverage for https pages that load insecure resources over http and produce the following Chrome console error:
"The page at 'https://www.mysite.com/' was loaded over HTTPS, but displayed insecure content from 'http://cdn.mysite.com/images/chucknorris.gif': this content should also be loaded over HTTPS."
Using CasperJS, how would you write a test to crawl an array of paths on a specific domain, identify which of those have insecure resource errors and log the insecure resource console error to a file?
edit: as noted by Chris, fs = require('fs'); should be used to allow writing the logfile.
You need to look at var fs = require('fs'); by default JavaScript does not write to your file system or it could be a major security risk so enabling this feature from phantom will allow you to write cookies files etc... Aside from using that to write log files you would have to read the output from casperjs using something like Python.
As far as how to crawl the domain, you would need to evaluate the domain to figure out what urls do I need to visit and or what urls do I need to click to bounce from page to page. this is a domain specific question only you will be able to answer after your analysis.

No admin data found

I tried to claim "Insight for my website" and i get the error "No admin data found at root webpage http://akcja-nikon.pl/. Insights requires admin data at this root webpage for the specified URL akcja-nikon.pl"
Admin tag data is there, i triple checked it, on both index.php and pickup.php (index redirects to pickup - in case you ask). I've done it almost a hundred times on all my other domains and never had a problem with that. I started having issues last week on this and one more domains.
Debugger scraps weird content for the URL an breaks after the first line on the HTML code
https://developers.facebook.com/tools/debug/og/object?q=akcja-nikon.pl%2Fpickup.php
and flags the error in red "Can't Download: Could not retrieve data from URL."
Any ideas? Maybe some weird Facebook cache?
Admin tag data is there, i triple checked it, on both index.php and pickup.php (index redirects to pickup - in case you ask).
No, it does not.
Your index.php redirects to agegate.php via JavaScript – which the Facebook scraper doesn’t care about.
And calling agegate.php directly, without any cookies set (which the scraper does not care for either), delivers a just an error message,
<br />
<b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in <b>/home/marketingpic/include-pl.php</b> on line <b>38</b>
together with an HTTP status code 302 Moved Temporarily and a faulty Location header that just says Location: pickup.php. (Faulty, because a fully qualified URL is required as value for a Location header by definition.)
And if I call your pickup.php, again without any cookies, it tries to send me back to index.php again (and again with a faulty Location header).
No idea, what exactly you are trying to accomplish here – but the way you are doing it right now, seems to be quite a nonsense.

apache url rewrite not working but redirect works, why?

I'm using an repackaged version apache which is called IHS (IBM HTTP Server). Basical the same as apache web serve with other features. What I'm trying to accomplish is to apply the rewrite rule to hide the complicated url with query strings with a shorten url.
Originally when I first test this out with 'R' Flag it work fine. It was able to match the pattern and response with the proper long url by redirecdt to the final url.
eg: https://example.com/us/ABC/123 -> https://example.com/webapp/headerText=ABC&categoryId=123
But after I have remote the 'R' flag, my rewrite failed with message of " File does not exist: /opt/IBM/HTTPServer/htdocs/dmcst/webapp". I'm trying to show the shorten url without given user the full url. The /webapp/.. is not an local path but rather it is a some other remote path. Why would this fail for 'rewrite' but not 'redirect'?
RewriteEngine on
Alias /wcsstore "/opt/IBM/WebSphere/AppServer/profiles/dmcwcsst/installedApps/WC_dmcwcsst_cell/WC_dmcwcsst.ear/Stores.war"
Alias /wcs "/opt/IBM/WebSphere/AppServer/profiles/dmcwcsst/installedApps/WC_dmcwcsst_cell/WC_dmcwcsst.ear/CommerceAccelerator.war"
Alias /static "/opt/IBM/content"
RewriteRule ^/us/([a-z].)/([0-9].)/?$ /webapp/wcs/stores/servlet/AcquisitionBrowseView?langId=-1&storeId=10001&catalogId=10051&headerText=$1&categoryId=$2 [NC,R,L]
From the WebSphere documentation:
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae%2Fujpx_rewrite.html
Rewriting rules define how the proxy server rewrites URLs. Responses
that have been redirected by target servers typically return a 302
status code with a location header that defines the URL that the
client should be redirected to. Rewriting this URL is necessary if the
target server is not aware of the proxy servers. The redirected URL is
modified to correctly point clients to the proxy server instead of
directly to a target server that may not be visible to clients. Use
the following properties to configure the URL rewriting rules for a
proxy server
Avoid trouble: The proxy server only supports rewriting redirected
responses. Therefore, these the following settings only apply to
redirected responses. These settings do not apply to requests because
the proxy server does not support URL rewriting for requests.
I had the same issue
It looks like WAS plug-in in not friendly with mod_rewrite
So WAS module declaration (LoadModule was_ap22_module ...) was moved to the bottom of httpd.conf
In my case it helped

Resources