w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

Requirements on connecting to https
Basically you have to add nothing, you only need to add http basic auth credentials if needed. This is how i usually connect to a https api with http basic auth. //Base URL NSURL *requestPasswordURL = [NSURL URLWithString:BASEURL]; //Http client with server credentials AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:requestURL]; [httpClient setAuthorizationHeaderWithUsername:@"user" password:@"password"]; //Set request parameters for example email NSDictionary *params = @{@"email": email}; NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:API_REQUEST parameters:params]; request.cachePolicy = NSURLRequestReloadIgnoringCacheData; //Prepare request AFHTTPRequestOperation *request = [[AFHTTPRequestOperation alloc] initWithRequest:request]; [requestPa

Categories : IOS

Connecting to https host with soapclient: how to fix SSL problems?
Interesting. Try adding this: wget https://[[SERVER]]/soap/ —post-file=request.xml —header=”Content-Type: text/xml” -O response.xml This will save the result as a file named response.xml.

Categories : PHP

Does connecting to an HTTPS:// destroy all current sessions?
You can find an explanation here Session lost when switching from HTTP to HTTPS in PHP Hope this helps you.

Categories : PHP

Haproxy 1.4 connecting to an https backend servers
haproxy 1.4 does not support SSL. Either update to 1.5 or look at using something like stunnel. I have used both in a very large enterprise implementation and both products work well. If you want to stick with haproxy 1.4 then the stunnel route is VERY easy. Simply install stunnel on your haproxy servers, listen on a local port, have haproxy connect to that local port and then configure stunnel to point to the remote https endpoint. Besides global settings in stunnel, the actual config would be 3 lines name listen port on localhost destination host and port

Categories : Ubuntu

Connecting to Alfresco with DotCMIS gives https error
Check the DotCMIS README file: The Web Services binding only works with HTTPS. The .NET framework does not allow calls with UsernameTokens over plain HTTP. You have to use HTTPS here.

Categories : C#

Can i capture https (CONNECT) urls using winpkfilter?
HTTPS is used to prevent any eavesdropping (which you are trying to do). Consequently when HTTPS is setup right, you can't do anything. If you have control over client computer and software, you can install a fake trusted root certificate to user's system, then intercept HTTPS requests, generate server certificate on-the fly, sign it with trusted root certificate and act as a man-in-the-middle. BTW find information about man-in-the-middle attacks and read them - that's exactly what you want to do.

Categories : C#

location.href not redirecting to https:// urls
Have you considered submitting the form via Ajax? The user would never leave the form submission page. You could simply display a modal with the confirmation message. That seems simpler than redirecting the user. It may be a nicer user experience as well. Let's assume your form has a submit button with a class of 'submit'. You could so something like this in jQuery: $(function() { $('body').on('click', '.submit', function(event) { event.preventDefault(); var target = event.currenTarget; var form = $(target).closest('form'); var action = $(form).attr('action'); $.post(action, form.serialize()) .done(function() { alert('Thanks for your submission!'); }) .fail(function() { alert(

Categories : PHP

Regex to match all https URLs except a certain path
I came up with the following pattern: ^https://[^/]+(/(?!form/|form$).*)?$ Explanation: ^ : match begin of string https:// : match https:// [^/]+ : match anything except forward slash one or more times ( : start matching group 1 / : match / (?! : negative lookahead form/ : check if there is no form/ | : or form$ : check if there is no form at the end of the string ) : end negative lookahead .* : match everything zero or more times ) : end matching group 1 ? : make the previous token optional $ : match end of line

Categories : Regex

.htaccess RewriteRule for https specific prefix urls
Replace your code with this: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s/+index.php?page=(paypaltest|postratingspro)[&;,s] [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTPS} on RewriteCond %{QUERY_STRING} !(^|&)page=(paypaltest|postratingspro)([,;&]|$) [NC] RewriteRule ^(index.php)?$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NC]

Categories : Apache

Unable to get maven to download from HTTPS URLs behind proxy
solution to your problem is https_proxy environment variable with cntlm authentication proxy. please find here answer! contact me if you need any kind of help!

Categories : Ubuntu

Using a Loadbalancer ssl terminated, how to generate links and other urls with https
We solved our issue. The problem turned out to be the load balancer configuration. The client is very compartmentalized and denied us access to the LB swearing that the config was correct. After proving to them that telnetting into 443 was being blocked for some stuff we were allowed access to the LB. In addition to just being set up wrong (cut and paste) the LB url rewrite rules were messed up. Fixing those all is good.

Categories : Asp Net

Force https for particluar URLs using Apache htaccess
You almost got it right. Just some small corrctions: # Forcing HTTPS RewriteCond %{HTTPS} !=on [OR] RewriteCond %{SERVER_PORT} 80 RewriteRule ^wp-admin/|wp-login.php https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] Also make sure these rules are right at top before any other WP rule.

Categories : Regex

Trouble connecting to Oracle with c#
it seems you need to update the oracle client library on your client machine. download it Oracle downloads

Categories : C#

Using htaccess to force https not working for full urls with htpasswd
I had similar problem, this is what worked for me. In your httpd.conf, under virtual hosts, make sure you have both: ServerName domain.com ServerAlias www.domain.com BOTH in VirtualHost *:80 AND VirtualHost *:443

Categories : Htaccess

Having trouble separating urls.py
name parameter is for a single url pattern. Remove it from this line in My_Project/My_Project/urls.py The regex pattern should not be '^$'. Instead just plain ''. url(r'', include('app_blog.urls'))

Categories : Django

Django storages or avatar sets https on my urls so I get certificate errors
I have fixed the issue. The way I did it was by replacing: DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' with: DEFAULT_FILE_STORAGE = 'storages.backends.s3.S3Storage' from S3 import CallingFormat AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN

Categories : Django

Clean URLs with mod_rewrite trouble
When including files, simply do include __DIR__."/myfile.php"; __DIR__ is for the current file directory, so you can then include files RELATIVE to that ABSOLUTE path. Such as include __DIR__."/../../some_other_file.php";

Categories : Htaccess

Having trouble with connecting SQLite in host Java
SQLite does not handle remote databases very well. According to their Appropriate Uses For SQLite page, "... Another way to look at SQLite is this: SQLite is not designed to replace Oracle. It is designed to replace fopen()." When you connect to an SQLite DB, you can only do it if you have direct access to the database file. If the file is shared on a remote drive, you can probably use jdbc:sqlite:\hostnameXX.sqlite as your connection string, but only if you can see the file that way in Windows explorer. On the other hand, you may want to try to install a database that intentionally allows remote connections. Apache Derby is a good one with a small footprint. It is written in Java and has a very nice and easy to use JDBC driver. Derby is available at http://db.apache.org/derby/.

Categories : Java

Trouble with SSL https connection on port 8443
Atlast it started working... Installed new copy of server, modified server.xml as below, --> <Connector SSLEnabled="true" acceptCount="100" clientAuth="false" disableUploadTimeout="true" enableLookups="false" keystoreFile="k:/tomcat.keystore" keystorePass="*****" maxThreads="25" port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS"/> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/> Used below command to generate keystore file keytool -genkey -alias tomcat -keyalg RSA -keystore k:/tomcat.kestore

Categories : Tomcat

WebScarab : Getting a PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException while connecting via https
Are you using WebScarab or WebScarab-NG? Please try WebScarab "classic", rather than the -NG variant. NG was a failed experiment, and no real effort was put into validating the client-side certificate functionality. Also, what version of Java are you using, what operating system, 32 bit or 64-bit, etc, etc Regards, Rogan

Categories : Java

Trouble connecting the cassandra database via remote access through JAVA
I could ping the machine. But I could not access the machine using telnet in windows. The servers is linux machine. Do you have any idea ? Your firewall is blocking off the telnet port and probably the rest of the ports cassandra needs. You need to add an exception telling the firewall to open port 9160 (the client port). 9160 is the only port you really need to have open unless you want remote jmx management etc. To add an exception to your linux firewall: iptables -I INPUT -p tcp --dport 9160 --syn -j ACCEPT And if you want to save the state: service iptables save

Categories : Cassandra

Trouble connecting to Postgresql database in Vagrant guest box with Induction from host machine?
check file pg_hba.conf looks like require allow connection most easy and lesss secure set 'trust' (everyone can use your postgresql) http://www.postgresql.org/docs/9.2/static/auth-pg-hba-conf.html

Categories : Postgresql

Trouble with simple https authentication with urllib2 (to get PayPal OAUTH bearer token)
Experiencing the same problem here. Based on Get access token from Paypal in Python - Using urllib2 or requests library working python code is: import urllib import urllib2 import base64 token_url = 'https://api.sandbox.paypal.com/v1/oauth2/token' client_id = '.....' client_secret = '....' credentials = "%s:%s" % (client_id, client_secret) encode_credential = base64.b64encode(credentials.encode('utf-8')).decode('utf-8').replace(" ", "") header_params = { "Authorization": ("Basic %s" % encode_credential), "Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json" } param = { 'grant_type': 'client_credentials', } data = urllib.urlencode(param) request = urllib2.Request(token_url, data, header_params) response = urllib2.urlopen(request).open() print

Categories : Python

Maven release plugin throws error when connecting to TFS repo using HTTPS - maven doesnt trust cert
Try retrieving the SSL certificate first. http://kingsfleet.blogspot.ca/2007/07/q-how-do-i-get-remote-server-ssl-cert.html?m=1 Then follow the instructions from one of my previous answers here: SSL client certificate in Maven

Categories : Maven

Trouble Connecting to sql server Login failed. "The login is from an untrusted domain and cannot be used with Windows authentication"
Why not use a SQL Server account and pass both the user name and password? Here is the reason why. In short, it looks like you have an authentication issue. The problem with workgroups is there is no common Access Control List like Active Directory (AD). If you are using ODBC or JDBC, the wrong credentials are passed. Even if you create a local windows account (LWA) on the machine (SE) that has SQL Express installed (SELWA), the credentials that will be passed from your client machine (CM) will be CMLWA.

Categories : Sql Server

Trouble connecting javascript code to html code
Check here The id for price was "tax" I think was just typo mistake. I changed also your input type sumbit to a button instead. Code: window.onload = function() { // this loads your script when the page loads function calculate() { 'use strict'; var total = 0; var quantity = document.getElementById('quantity').value; var price = document.getElementById('price').value; var tax = document.getElementById('tax').value; var discount = document.getElementById('discount').value; total = quantity * price; tax /= 100; tax++; total *= tax; tax = tax / 100; tax = tax + 1; total = total * tax; total -= discount; document.getElementById('total').value = total; return false; } }; You can add this code to your page or call it

Categories : Javascript

JAVA - Tomcat 5 Application connecting to Web Service using HTTPS, while Tomcat 7 Application does not
It would seem that the root cause of this problem is that when you are running the newer version (tc7, jdk1.7) you application is unable to find the certificate store. Are you specifying where the certificates are stored in you java code? Or anywhere else for that matter? If so you may be doing it in a Java1.4 way that has been updated in later versions. The default certificate store for java is {$JAVA_HOME}/lib/security/cacerts If your certificate is not being stored here, then this may be your problem. This store is per java version so this would explain why the older version is working while the new version is not. (This is covered in the post linked to by Michael) If this doesn't fix the problem, then it would be useful if you could post some more information about how you are con

Categories : Java

Python HTML parsing script that takes array of URLs and outputs specific data about each of the URLs
import urllib2 from bs4 import BeautifulSoup url = 'http://www.youtube.com/watch?v=QOdW1OuZ1U0' f = urllib2.urlopen(url) data = f.read() soup = BeautifulSoup(data) span = soup.find('span', attrs={'class':'watch-view-count'}) print '{}:{}'.format(url, span.text) If you do not want to use BeautifulSoup, you can use re: import urllib2 import re url = 'http://www.youtube.com/watch?v=QOdW1OuZ1U0' f = urllib2.urlopen(url) data = f.read() pattern = re.compile('<span class="watch-view-count.*?([d,]+).*?</span>', re.DOTALL) r = pattern.search(data) print '{}:{}'.format(url, r.group(1)) As for the outputs, I think you can store them in a csv file.

Categories : Python

Flask approach to creating URLs for resources whose URLs are different in production and in dev
The endpoint name needs to include the argument you want to pass to url_for. @bp.endpoint("/image_repo/<path:path>") def image_repo(path): if in_development(): return send_from_directory(current_app.instance_path, "<relative path>") else: return redirect("<cdn path>") EDIT: after re-reading the question, my original answer below isn't really a direct answer since you want to use a CDN, not just a separate location, sorry. Flask has a builtin solution for this called the instance folder. By default the instance folder will be next to your package (or module) during development, or in /<install prefix>/var/<package name> when installed in site-packages in production. You can access it's contents without knowing it's path with curren

Categories : Python

How can i read a file for urls and then launch all the urls in browser using python
with open('Path/to/file', 'r') as content_file: content = content_file.read() urls = content.split() for url in urls: webbrowser.open(url) You can also try webbrowser.open(url, 2) to try to open the links in new tabs.

Categories : Python

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

Redirect wordpress urls to joomla urls on the same domain
Use RedirectMatch to specify a pattern. RedirectMatch 301 /([^/]+)/([^/]+) /$1/category/id-$2.html Using mod_rewrite instead, you would be able to restrict the redirection to happen only when the URL path (i.e. the directory structure /eng/news/) physically does not exist. RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d # not a dir RewriteCond %{REQUEST_FILENAME} !-f # not a file RewriteRule ^([^/]+)/([^/]+)$ $1/category/id-$2.html [R=301,L] This assumes your .htaccess resides in the web root folder.

Categories : Wordpress

How to rewrite old urls to new urls to preserve Google Ranking
Note that Redirect is not part of mod_rewrite, it's part of mod_alias, and you don't need to turn on the rewrite engine to use it. If you wanted to "rewrite", as in, change the URL internally within the server, and the rest of the internet doesn't know it's been changed, then you'd use mod rewrite, and not a redirect: RewriteEngine On RewriteRule ^/?sompage/index.html$ /page.php?id=10 [L] If you want to redirect all requests to the new URL(s), then you can use Redirect just by itself. This lets the rest of the internet know that the URL has been changed and to stop going to the old one. With a 301, google knows that whatever metadata it has stored for the old URL should get migrated to the new URL when there is a 301 redirect (permanent): Redirect 301 /somepage/index.html /page.php?id

Categories : Htaccess

how to redirect users from old urls to new urls in SEO friendly manner
You should go with php just add following code in your old URL, it will redirect you to new URL new URL1 <?php header("Location: http://threads.example.com/IN/24/215/sample-thread.html"); ?> Do this for all pages

Categories : PHP

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

Once https page is visited, all subsequent pages are served from https
ok I think I found the reason. The links I am visiting are relative, so "/forum" for example. Once https is in the browser it seems like visiting a relative address is leaving the root as https:// and appending the relative path. I believe the fix here will be to use the full path for the link instead of relative.

Categories : Htaccess

when using https, https can't find codeigniter controllers. Running Centos
Change this line : RewriteRule ^(.*)$ index.php?/$1 [L] to : RewriteRule ^(.*)$ /index.php?/$1 [L] The .htaccess would otherwise be redirected relatively to a index.php in the join folder, which off course is not there.

Categories : PHP

How can i convert links to https when server providing https?
If you remove the http:// portion and use instead: <script type="text/javascript" src="//static.monstermmorpg.com/js_files/jquery-1.9.1.min.js"></script> It should request based on the current scheme being used.

Categories : C#

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



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