Ram Posted February 8, 2012 Share Posted February 8, 2012 Hi, I am looking for a way to do the following: For example: I open a browser (say Fire Fox, IE or Chrome) in the address bar I type www.google.com and press enter automatically the url should be redirected to plus.google.com Is this possible? I am trying to do this using HOST file on my computer but the problem is that HOST files accept only IP address so the subdomain url don't have the actual iP address hence I can't do it with HOST file. Can the above scenario be achieved using autoitscript? if so how do I go about doing this? Thanks! Link to comment Share on other sites More sharing options...
Mikeman27294 Posted February 8, 2012 Share Posted February 8, 2012 (edited) My brother's response:Yes, it can be done with AutoIt. However! The following requirements must be met:1. Language requirements - eg. This can ONLY be run on windows. Trust me. I tried running this on WINE under Ubuntu. Didn't work.2. CGI-capable server. XAMPP is fine for this HOWEVER the folder this file is put in MUST be able to execute CGI scripts. In XAMPP, this is XAMPP_dir/cgi-bin/ by default.We are going to output some HTTP1.1 headers. You don't need to understand much, other than it must be the first to come out before the HTML, and even more importantly, it must go out through 'Standard Output'. And guess what - AutoIt supports standard output - tested and verified by me. However it may seem a bit strange for web-based applications. Enough of me babbling.Put the following in a file and compile it as plus.exeConsoleWrite("Location: plus.google.com") ; Will redirect to google plusThat's it!Just compile it as a .exe THEN rename it to .cgi.Then put it in your cgi-bin and navigate to the file in your web browser. If this has been done correctly, you will have a redirect to google plus! Good job - I knew you could do it! Edited February 8, 2012 by Mikeman27294 Link to comment Share on other sites More sharing options...
Ram Posted February 8, 2012 Author Share Posted February 8, 2012 My brother's response: Yes, it can be done with AutoIt. However! The following requirements must be met: 1. Language requirements - eg. This can ONLY be run on windows. Trust me. I tried running this on WINE under Ubuntu. Didn't work. 2. CGI-capable server. XAMPP is fine for this HOWEVER the folder this file is put in MUST be able to execute CGI scripts. In XAMPP, this is XAMPP_dir/cgi-bin/ by default. We are going to output some HTTP1.1 headers. You don't need to understand much, other than it must be the first to come out before the HTML, and even more importantly, it must go out through 'Standard Output'. And guess what - AutoIt supports standard output - tested and verified by me. However it may seem a bit strange for web-based applications. Enough of me babbling. Put the following in a file and compile it as plus.exe ConsoleWrite("Location: plus.google.com") ; Will redirect to google plus That's it! Just compile it as a .exe THEN rename it to .cgi. Then put it in your cgi-bin and navigate to the file in your web browser. If this has been done correctly, you will have a redirect to google plus! Good job - I knew you could do it! what do you mean by saying "navigate to the file in your web browser" - does it mean I doing something manually if so the idea is that.. when ever i enter google.comon my address bar - it should automatically redirect me to plus.google.com. Link to comment Share on other sites More sharing options...
Mikeman27294 Posted February 8, 2012 Share Posted February 8, 2012 What he meant by that, is you type into your address bar: localhostCGIBinFilename.cgi If you have a domain name, you should be able to replace localhost with the domain name. Link to comment Share on other sites More sharing options...
willichan Posted February 8, 2012 Share Posted February 8, 2012 in the address bar I type www.google.com and press enter automatically the url should be redirected to plus.google.comIs this possible?To redirect a domain you own/control is very simple. For a domain you do not control, you need to control the network, and know what you are doing.To redirect the www.google.com url, you will need to have control over your DNS, either by proxy server or by your own DNS server. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
Ram Posted February 10, 2012 Author Share Posted February 10, 2012 It can probably be done with AutoIt, but that would be about the most retarded way to do it. If you are using Firefox, install Greasemonkey and then install a custom redirection script. It only takes a few lines of javascript to do this. var loc = String(location); if (loc.match(/www.google.com/i)) { loc = loc.replace("www", "plus"); window.location = loc; } Thanks for the help installing plugins and working on it ...is lot of work. I guess this time AutoIT can't me help with this... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now