w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
SSL http to https redirection using drupal
From https://drupal.org/https-information: Drupal configuration If you want to support mixed-mode HTTPS and HTTP sessions open up sites/default/settings.php and add $conf['https'] = TRUE;. This enables you use the same session over HTTP and HTTPS both -- but with two cookies where the HTTPS cookie is sent over HTTPS only. You will need to use contributed modules like securepages to do anything useful with this mode, like submitting forms over HTTPS and so on. While your HTTP cookie is still vulnerable to all usual attacks, a hijacked insecure session cookie can only be used to gain authenticated access to the HTTP site. It will not be valid on the HTTPS site. Whether this is a problem or not depends on the needs of your site and the various module configurations. For example, if all

Categories : Apache

Firefox showing strange behaviour in css margin padding not working
For your case, you would only want to set either the top or bottom of your absolutely positioned element. In this case that would be #loadingImage. You have both top, and bottom set. If you're trying to get it to be positioned 220px from the top of what the #loadingImage position is relative to, use top. Otherwise use bottom, and remove top. From MDN: "If both top and bottom are specified (technically, not auto), top wins." "If both left and right are specified, left wins when direction is ltr (English, horizontal Japanese, etc.) and right wins when direction is rtl (Persian, Arabic, Hebrew, etc.)." This is not to say you can not use top and bottom at the same time (or even left and right for that matter). But you would only do that specifically for when you want to fill the space be

Categories : HTML

Facebook like button https issue: protocol mismatch from http and https
Reviewing the js code on Facebook there are multiple urls containing hard coded strings for http://static .../rsrc.php it's possible those are the files triggering the error. This may be something Facebook needs to update. On a side note, it may be possible to download that js file from Facebook and store it on your server and remove the hard coded http string. I would test this further but I am on my phone at the moment.

Categories : Facebook

How do you enable https and http->https redirects in ring / compojure
It's possible to serve HTTPS with clojure, but it's much more popular to put nginx or something like that in front of your ring server. If you can figure out how to configure jetty, though, run-jetty clearly supports SSL.

Categories : Http

Can https fallback to http and security level of https
No, HTTPS never falls back to HTTP automatically. It would take deliberate action by the user. If you're just going to a web page by putting its URL into the address bar, this is easy; for form submission it's harder. Yes, sending plain text over SSL is fine. In fact, sending a hashed password doesn't really increase security much at all -- if someone manages to sniff the connection and gets the hashed password, that's all they need to be able to login to the site. It has one small advantage: if the user uses the same password at multiple sites, learning the hashed password for one site doesn't help them get into another site that uses a different (or no) hash. And it's not likely to be feasible to send salted hashes, since the client doesn't know the salt. A cnonce adds an extra level

Categories : Asp Net

Redirect all http AND https non-www URLS to https://www.xyz.com via htaccess
In case anyone from the future (HELLO PEOPLE OF THE FUTURE) stumble across this, I asked the same question and had it answered over at Server Fault. Short version: impossible. Long version: http://serverfault.com/questions/523199/redirect-all-http-and-https-non-www-urls-to-https-www-example-com-via-htaccess

Categories : Htaccess

Display message on https redirection
Some widely accepted certification authorities offer a free certification path for Class 1 certificates (which make no assertion over the identity of the certificate owner, only that they control the subject; in reality, few people actually check SSL certificates for identity verification, so this is rarely a realistic concern—and given the non-commercial nature of your application, may not be a concern at all in this case). One such certification authority (that I have used myself in the past) is StartCom.

Categories : Java

Domain DNS settings redirection (www to https)
The CNAME only tells the browser (or more accurately, the resolver) how to find the IP address of the domain name. In this case, when the browser tries to resolve "www.example.com", it finds a CNAME record, so it needs to follow that alias and resolve "example.com". Eventually, it should arrive at an IP address to which it can make a HTTP(S) connection. In short, yes, you need to setup the redirection on your web server as well.

Categories : Iis

ASP.NET - Strange Bug in Page Redirection
If you put breakpoints in your Page_Load, Cancel_Click, and Button_SaveChanges_Click methods and debug, what I believe you'll find is your Page_Load is firing and causing the redirect due to the code in that method. You likely need to add a check to determine that it is not a postback - like so: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //current Page_Load code in here... } }

Categories : Asp Net

Nginx 'rewrite or internal redirection cycle while internally redirecting' resulting in 500
Have you tried something like this? (specific to Magento maybe) server { listen 80 default; ssl off; root /var/www/magento; server_name mydomain.com.au; location / { index index.html index.php; try_files $uri $uri/ @handler; expires 30d; } location ^~ /app/ { deny all; } location ^~ /includes/ { deny all; } location ^~ /lib/ { deny all; } location ^~ /media/downloadable/ { deny all; } location ^~ /pkginfo/ { deny all; } location ^~ /report/config.xml { deny all; } location ^~ /var/ { deny all; } location /var/export/ { ## Allow admins only to view export folder auth_basic "Restricted"; ## Message shown in login window a

Categories : Wordpress

C HTTP Server & OpenSSL - Works fine for HTTP - Multiple/rapid/concurrent connections being dropped using HTTPS
You should call SSL_accept() in your request handling thread. This will allow your listening thread to process the TCP accept/listen queue more quickly, and reduce the chance of new connections getting a RESET from the TCP stack because of a full accept/listen queue. SSL handshake is compute intensive. I would guess that your spammer is probably not using SSL session cache, so this causes your server to use the maximum amount of CPU. This will cause it to be CPU starved in regards to servicing the other connections, or new incoming connections.

Categories : C

Htaccess redirects http://www... to https://www..., but does not redirect http://www
Try this: RewriteEngine On #not https RewriteCond %{HTTPS} off RewriteRule .* https://www.metalmetalland.com%{REQUEST_URI} [R=301,L] #https, but not www RewriteCond %{HTTP_HOST} !^www. RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Categories : Apache

htaccess rewrite all using http:// or http://www. to https except for one or two URI
Move the rewrite condition to the part where http: is ON not where https: is already ON. RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} !^/folder/next_folder/custom_id RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} ^www.(.*)$ RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

Categories : Htaccess

nginx proxy based on host when using https
according to http://www.informit.com/articles/article.aspx?p=1994795, you should indeed have two "server" sections, with two different server names. In each one, you should include your ssl_* directives.

Categories : Ssl

Strange behaviour with C# SQL
You need to use single quotes to specify a string in SQL. So string sql = "SELECT column1 FROM table1 INNER JOIN table2 ON table1.table2ID = table2.table2ID where column1 = 'testData'";

Categories : C#

Strange AUI behaviour
First of all, .use() is called asynchronously. When calling AUI().use('node', function(A) {...});, the node-module has to be loaded and attached before the the function inside (function(A) {...}) is called. So what is happening is that while the node-module is being loaded, the code lines after use() are being called, and when the module has been successfully loaded and attached, the function (function(A) {...}) is called. See the documentation on .use() here: http://yuilibrary.com/yui/docs/yui/#understanding-yuiuse (AUI is an extension of YUI) This might also be helpful: Getting started with YUI3 and AlloyUI

Categories : Misc

Strange this-> behaviour
First of all, check that other.Name is filled with a pointer to a null-terminated string, that other.foundationDate contains a null-terminated string. That is, you pass good pointers to strlen and strcpy. If that's true, check that B in the assignment is accessible altogether. If that's true too, printf everything. And debug where exactly the exception occurs. Or post whole code that is compilable and which reproduces the error. Also note that here: this->members = new Person[this->maxMembersCount]; this->members = other.members; the first assignment does nothing (leaks memory, in fact) while the second double deletes your memory upon object destruction (if you properly delete[] members).

Categories : C++

Nginx serving non-secure resources on https domain
maybe cause this is how they are called, if you need to serve every thing as https, i would create an empty server that listens on 80 and redirect to https server { # listen 80; delete this part listen 443 ssl; # the rest of the config } # add this server server { listen 80; server_name example.com; location / # or a more specific location '~ .(jpg|css|js|jpeg|png|gif)' { return https://example.com$request_uri; } } or just fix the css location, it might be an absolute URL with http

Categories : Magento

Nginx https redirects - stop further rules processing
I usually like to use return instead of rewrite for redirects, try matching the path with a location block location ~ /path/resource(.*) { return 301 $scheme://newdomain.com/newpath/resource$1; } I think this way you know for sure there will be no further processing, because it's only 1 line, try it and tell me how it goes. PS: This will maintain the $scheme of the request, requests to http:// will be redirected to a http:// and https:// will be redirected to https://

Categories : Http

Strange Goroutines Behaviour
When main exits, the program terminates regardless of the state of other goroutines. You can test this by adding select{} at the end of your main function. This will cause main to never exit and you will see the other goroutines run. If you want your program to exit cleanly (without a deadlock) when both goroutines complete, you need to use something like a channel or sync.Waitgroup to coordinate main ending when everything is complete. Example using sync.Waitgroup: package main import ( "fmt" "sync" ) func f(from string, wg *sync.WaitGroup) { for i := 0; i < 3; i++ { fmt.Println(from, ":", i) } wg.Done() } func main() { wg := new(sync.WaitGroup) wg.Add(2) go f("direct", wg) go f("redirect", wg) wg.Wait() } Example using channel

Categories : Go

Strange behaviour with the sed command
sed does not recursively match output patterns. That is, the input line is read, and when a pattern is matched, the modified output is generated, and the rest of the input line is scanned. The "s" command will not scan the newly created output. Thus, after you replace the first LES with , the newly created space will not be scanned, and the next LE will not be matched since there is no leading space. Alternative solution: echo "VAL LES LE VAL LE VAL" | sed -E -e 's/ *LES?//g'

Categories : Linux

Strange behaviour of fgets
Its because whatever is writing your pipe isn't flushing its out buffer. When you print, it ends up flushing that (not garenteed to happen though). When you don't print, the pipe isn't actually getting written to because its because stored in a kernel buffer until it fills, and then the kernel will write the data. Call fsync or flush on the pipe fd in the process that is writing to the pipe to make sure that the kernel buffer is flushed.

Categories : C

Strange behaviour with UserHostAddress
Request.UserHostAddress internally returns the IIS server variable REMOTE_ADDR. So, answer to your question really depends on how IIS decides to populate this server variable based on the TCP connection made by the client. I do not know what IIS does but here is my guess. REMOTE_ADDR is nothing but the source IP of the network packet that reaches the server. This source IP depends on how the network packet gets routed to your server. My guess (and I'm very positive about this) is that since App1 and App2 are in the same physical box, the request never had to go through the physical network card and becaue of this IIS can determine that the request comes from the same machine it runs on and hence it returns the IP associated with the binding. Check this out. When App3 calls App1 or App2, t

Categories : C#

Strange jQuery behaviour
Looks to me like it runs the true branch regardless: http://jsfiddle.net/tMwRV/ Which makes sense. You are setting the value to 2, not checking the value. The statement $("#SendingType").val(2) returns a jQuery object, which is "truthy".

Categories : Javascript

Strange behaviour in OpenGL
You need to take the alignment into account. By default, GL expects a 4 byte alignment for each image row. Asy you use 3 bytes per pixel, can be anything, depending on the width. Have a look at glPixelStore() to change the alignmet. Especially useful should be setting GL_PACK_ALIGNMENT (for reading pixels from the GL) and GL_UNPACK_ALIGNMENT (for sending pixels to the GL) to 1 for your use case.

Categories : Delphi

Strange behaviour activity
If you want a certain behaviour, you have to specify it via android:launchMode in your manifest or flags for Intent

Categories : Android

some strange behaviour of `stat()`
You have a bogus in your dirname_. When you print the directory name inside the loop and run through strace, the output looks like write(2, "dirname : ", 10) = 10 write(2, "./zLOZ2nOXpP/7U20o0J90x", 25) = 25 write(2, " ", 1) = 1 stat("./zLOZ2nOXpP", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 So, cerr or cout correctly print the string (using its length), but when converting to a C-String with c_str() the result is only the first directory name, which is then passed to stat().

Categories : C++

Console log with if, strange behaviour
Exactly, as you can see + has higher precedence than ? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence So in your first expression string concatenation with the boolean value (a === 'xyz') gets executed first, the non empty string is then evaluated as a boolean true and 'A' is the final output. In the second expression parenthesis force the ? operator to be executed before +.

Categories : Javascript

DropDownList Strange Behaviour
Okay, I figured it out. The solution is to basically populate the values in Page_Load, to use !IsPostBack so it's only populated once, and to call it whenever the values need to be changed during run-time. This is following the points mentioned by Cam Bruce and gunr2171. Thank you so much everyone for the help!

Categories : C#

Strange behaviour when using pointers
In your code that shifts the value, you are reading the highest byte from the lowest address (bits 40-47 from offset 0). I'm guessing your second case is running on a x86 machine, thus reading the lowest byte from the lowest address (because that's how x86 is defined, as is MANY other processors, they are called "little-endian" machines). If you want the bytes in that particular order, on a little-endian machine, you will have to get bytes one by one and shift (if you wanted a whole 64-bit value, it may have been possible to use a byteswap instruction on x86, but I doubt it's enough value in that when you then need to "undo" that by shifting and masking the 16 bits you didn't actually need).

Categories : C

Strange behaviour of ViewState
I don't want to say a wrong thing, but, reading from documentation, it was written that "Viewstate is used to preserve page and control values between round trips" http://msdn.microsoft.com/en-us/library/ms178198(v=vs.85).aspx Have you tried to put the URLs in variables, and then assigning to ViewState["imgX"], and try to do another Postback and see if the ViewState["imgX"] contains the URL?

Categories : C#

Strange behaviour of struct in C++
The difference is wich @jhonchen902 suggest in the comment: The problem specifies output must be floating-point numbers with four digits after the decimal point. In your first version, you where using integers.

Categories : C++

Strange behaviour of c++ constructor
Data is constructible from Word, so you can pass a Word to the Work constructor. Under the hood, an instance of Data will be created from the passed Word and, in turn, passed to the constructor. You can avoid this by marking the constructor of Data that takes a Word as explicit, like this: class Data { public: const Word &word; explicit Data(Word w) : word(w) {} }; That way, the constructor cannot be implicitly applied anymore, and your call to the Work constructor will fail to compile unless you explicitly invoke the Data constructor: const Work *work = new Work(words); // Implicit call, fails to compile. const Work *work = new Work(Data(words)); // Explicit call, compiles.

Categories : C++

Strange behaviour of ArrayList in jsf
Service method is called each access of electrolyserMaterialLotList and the list prepared by accessing to database and doing same operations again even for single item access. You should avoid doing so. Basically, you can use null check in getter method. public List<MaterialLotSummaryData> getElectrolyserMaterialLotList() { if(electrolyserMaterialLotList == null) { MaterialLotFilter materialLotFilter = new MaterialLotFilter(); materialLotFilter.setElectrolyserId(id); electrolyserMaterialLotList = materialService.getMaterialLotByElectrolyserId(materialLotFilter); } return electrolyserMaterialLotList; }

Categories : JSF

strange closure behaviour
In API references: @view path: contents Define an inline template. It’s like you had a file on disk at path inside Express’ views directory. It will have precedence over a template on disk. Since "It’s like you had a file on disk at path inside Express’ views directory", so everything under @view is in a separate file/module, which explains why you cannot access all.

Categories : Javascript

Strange behaviour of the pow function
This is to do with floating point inaccuracy. Although you are passing in ints they are being implicitly converted to a floating point type since the pow function is only defined for floating point parameters.

Categories : C

Strange behaviour of getch()
From _getch() When reading a function key or an arrow key, each function must be called twice; The first call returns 0 (for F1-F10) or 0xE0 (224) (for others) , and the second call returns the actual key code.

Categories : C++

jQuery on(): strange behaviour
If you have a click handler on an element that contains .link-follow-stop and it uses e.stopPropagation(), this will prevent the event from bubbling up to document. The second form of .on() depends on the event bubbling up to the element that that handler is bound to; it then checks whether the actual target of the event matches the selector. The following demonstrates this: <div class="outer"> <div class="inner"> Click here </div> </div> $(function() { $(document).on("click", ".inner", function() { alert("inner"); }); $(".outer").click(function(e) { e.stopPropagation(); alert("outer"); }); }); FIDDLE When you delegate with .on() you should bind the handler to the most specific static element(s) that cont

Categories : Jquery

Strange Ajax Behaviour
Your scripts are being loaded asynchronously, so you cannot guarantee the order they are loaded. I'm also confused about why you're loading jquery using a jquery function $.getScript()... But disregarding that, you should load scripts after their dependencies have been loaded: $.getScript('/path/to/dependency', function(data, textStatus, jqxhr) { $.getScript('/load/dependant/script/here'); }); http://api.jquery.com/jQuery.getScript/ You should also look at Deferred objects that jQuery has that makes loading several dependencies easy: http://api.jquery.com/category/deferred-object/

Categories : PHP

mysql_query() Strange behaviour
You close connection to DB mysql_close($con); after that you try to call mysql_insert_id(); Of course, it will return false. Try to use public function __destruct () { mysql_close($con); } instead of mysql_close($con); in your class.

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.