On my website some pages are secure and some are not. I have a search form on each of my page (as a part of a template) and when I'm on https page and launch the search, the results page shows nothing. I know I must be loosing my posted data because of the redirection. Would excluding the results page from being redirected solve my problem? I want it to be http at all times. If that's the case - what exactly do I need to put inside of my .htaccess?
If you ensure the search form uses 'http:searchurl' in the action rather than just 'searchurl' then it should work
Related
I am using express in one of my application. I want to make a post request to a url but it should also redirect to that url. Like when we submit a form using GET/POST method it redirect us to that url (). The only solution which is coming in my mind is
make a hidden form
redirect to that form from controller with data
Submit form using js on page load.
The only disadvantage of this solution is user will see a black page for some time till the form gets loaded.
Can anyone suggest some better solution ?
I think what you are looking for is not a "redirect." It's a solution which will send an extra request to another(or the same) URL and get the result from there instead of showing a blank page to the client for redirecting.
If that's correct, please refer to this similar question:How to forward a request to other endpoint in node.js
If you're looking for redirection (HTTP 301 & 302), the easiest way to do it is passing your data through GET URL query string. You can encrypt your data to prevent security risks.
I want to get the address of a page after redirect. I have the following code
url = 'https://simple.wikipedia.org/wiki/Gcd'
print(urlopen(url).geturl())
But it doesn't work, it prints https://simple.wikipedia.org/wiki/Gcd, while it should print https://simple.wikipedia.org/wiki/Greatest_common_divisor.
So, what is the problem with it?
There is actually no problem. The URL you get when opening https://simple.wikipedia.org/wiki/Gcd is exactly that URL. The only way for the URL to change would be a redirect, and if you look at the response from that URL, you can see that it returns just a 200 status code. So there is no redirect.
However, when you open the URL in the browser, the URL does get changed to https://simple.wikipedia.org/wiki/Greatest_common_divisor. How does this happen when there is no redirect?
This is actually a new MediaWiki feature that rewrites the URL in the browser using the History API. It simply replaces the URL that is displayed in the browser—but without actually making a new request or being a true HTTP redirect.
It’s a functionality that only works in modern browsers with JavaScript enabled. Otherwise, you would stay on the Gcd URL which is also the behavior from older versions of MediaWiki.
You can learn more about this new MediaWiki feature in the Phabricator task T37045.
As for your “problem” with it, you should consider communicating with MediaWiki using the MediaWiki API which will also tell you when a page is a redirect.
I used the third party cart system from Ecwid. When I click on any prouduct, it shows this link or URL:
http://www.bestsports.ca/product.php#!/~/product/category=9414048&id=11484861
How can I rewrite this URL instead of showing category id? I want to show the product name. I already tried your above instruction but its not working. Can you please explain is it possible to make this URL into this SEO friendly URL?
http://www.bestsports.ca/MMAGEAR/productname/
I want so show first URL like above URL.
It is not possible for .htaccess to rewrite URLs with a hash (#) symbol in them. That is because everything after the hash is considered a fragment identifier. The purpose of the fragment identifier is to specify the content to be show within the HTML document. It may be handled:
By the browser by scrolling to the correct place in the page
By JavaScript by loading and displaying the specified content
In your case, it appears to specify the AJAX content to be displayed. That is handled client side by JavaScript.
The hash and everything after it are not even sent to your server. They are client side only. Because of this, there is no possibility for your server to rewrite a URL based on the information after the hash. .htaccess can't even get this information.
The only way for you to rewrite these URLs would be to modify the JavaScript in the page to have it change the document.location to the URL of your choice.
I have an URL that redirects to another. (Both sites are hosted by myself)
How can I mask the final URL to show the first one?
The easy answer: You cannot. The browser (or any script accessing the content at that given URL) shows the user where the data is coming from - and that's the redirection target, since that's where the data is coming from.
The complx answer: You can. However this required quite a bit of work. The server internally has to fetch the data for the redirection target and forward it to the client. However strictly speaking this isn't a redirect any more that you can perform using a .htacess configuration.
I'd like to know how websites have created URLs with other domains like these on trafficestimate.com.
I'm guessing it's some .htaccess stuff to redirect domain names to a dynamic page?
Thanks
Your URL has an GET Request. So when someone calls the page http://google.com/search with the parameters hl=en, safe=off etc., the page can process those parameters. So for instance safe=off means that you want to get back any search result. The q=site:... is your search string. In this case Google will look it up in its database and give you the results. So when you call this URL there is probably no .htaccess processing done. However you can process the URL and GET request with .htacces and i.e. redirect the user to another page.
Maybe you'll describe a bit further what exactly you trying to do/want to know. This makes explaining easier.
EDIT: After reading Gumbo's comment I looked at the Google result page. So maybe your question means the trafficestimate-URLs. They look like http://trafficestimate.com/example.org. This is really a good case for .htaccess. So using .htaccess they take the URL and redirect it to http://www.trafficestimate.com/websites/?domain=example.org. Here you have again a GET request and an application builds the page.
Some URL rewriting is probably involved. Otherwise they would have to create an existing file for every possible request.
Using Apache’s mod_rewrite in a .htaccess file is one option. But since the server identifies itself with “Microsoft-IIS/7.5”, they are probably rather using ISAPI_Rewrite, a mod_rewrite derivative for Microsoft’s IIS.