how to redirect from one domain to another .htaccess

Really simple and straightforward. There are several use cases that I can come up with that applies to URL redirection. For my own website I've been using lot of this stuff so would like to share it. You dont have to be master of anything to do these sort of things because they are really straightforward. But if you like to go into much depth of mod_rewrite then offcourse you can read the book on to the right. I am dead sure that you will find this book helpful. Three steps to make sure that all will work correctly as as below. First make sure that Apache mod_rewrite module is available and is loaded Scondly make sure that under your website directory options you have AllowOverride option set to all i.e. <director “path/to/your/website/directory”> AllowOrderride All </directory> Third is to make this change in your .htaccess file For redirecting everything from yourdomain.com to yourdomain2.com do this The above will work but more better way to do the above is below. This applies where you got no control over Apache configuration and you are not sure whether mod_rewrite module is available or not. The above lines thus can be rewritten as below I hope this helps. … [Read more...]

Apache redirect all traffic to www. and vice versa in .htaccess

Hi Guys, So I had this problem few weeks back and would like to share the solution with you. My dilemma was to redirect all traffic from http://www.jaspreetchahal.org to  http://jaspreetchahal.org There were few reasons why I wanted it to be like that. One of them was the Google Analytics stuff. GA works on per domain name basis (Correct me if I am wrong here) so tracking for jaspreetchahal.org is not same as for www.jaspreetchahal.org. Now I had a choice to either put the tracking on for both www.jaspreetchahal.org and plain jaspreetchahal.org. I am glad that the solution was this simple. I strongly recommend this book on mod_rewrite for you We just need to edit our .htaccess file in the root directory of your website. Three steps to make sure that all will work correctly Make sure that you Apache mod_rewrite module is available and is loaded Make sure that under your website directory options you have AllowOverride option set to all i.e. <director "path/to/your/website/directory"> AllowOrderride All </directory> Third is to make this change in your .htaccess file For redirecting everything from yourdomain.com to www.yourdomain.com do this For redirection everything from www.yourdomain.com to yourdomain.com do this Another thing I would like to add here is that If you are not sure if mod_rewrite is available or not then its always a good idea to wrap your Rewrite code with <Ifmodule> tag as shown below The above lines thus can be rewritten as After you made the above change then based on the rule you've used your website visitors will be directed accordingly. … [Read more...]

Batch Sleep Command : batchsleep.exe

Hi Guys, batch sleep command has been tested on Tested on windows vista, windows 7, SBS 2011, Windows 2008 R2 So I had this problem where I have to introduce 20 second pause during my batch execution. I did not find any Microsoft Windows command that does this sort of stuff. So I wrote batchsleep.exe. This utility can be downloaded from this page. You have to scroll a bit to get to the download link :) Alright lets get back to the util now. Here are the usage instructions for using batchsleep.exe. First up wherever you extract this archive make sure to add that path in Windows Environment Path variable so that it is available from any where By default batchsleep will pause for 1 second but you can override that behaviour by using something like this // above command will introduce a pause for 10 seconds Now this above command will output few lines of text. So if you like to run it quietly then do it like read the above as "Pause for 10 seconds quietly" Prerequisite: .NET framework >= 2.0   {filelink=8}     Now the main part, the license and liability THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software is spyware free and virus free.Now there is another similar utility out there which I sort of found after I wrote … [Read more...]

Workaround: window.status not working on FF, Chrome, IE7, Safari

Hi Guys, Alright! so you are in same boat that I was until I did a little trick to get around this problem. Need for using windows.status arises when you don't want user to see You affiliate links Your advertisement links Simplified URL hide status bar onmouseover Custom message etc etc Your use case can be totally different to the above. The technique I am going to show you has been used on couple of links on this screen. Try to hover and check out the link  below. (affiliate link) This stuff use to be so simple in old days when we can reliably use window.status="whatever" so with old technique we can do something like this if I want to hide say my tracking code then I will do something like this As you may already know that because of security reason this window.status does not work the way we wanted to unless you adjust your browser security settings. The text below is taken from w3schools Note: The status property does not work in the default configuration of IE, Firefox, Chrome, or Safari. To allow scripts to change the text of the status, the user must set the dom.disable_window_status_change preference to false in the about:config screen. (or in Firefox: "Tools - Options - Content -Enable JavaScript / Advanced - Allow scripts to change status bar text"). Now if you have to tell your visitors to do that, then first thing that will happen is that you will not see them again :):) I guess. Now lets do a little trick using jquery add this jquery function to a global javascript file that is accessible across your website Now that we've a working function to trap our link click I did this to change my hyper link Alright so the above technique works on all browsers with javascript enabled. Now lets answer what if javascript is disabled? I am sure that you've heard noscript tag in HTML Well yeah, you are thinking right. Below is to get around if javascript is disabled. I hope this … [Read more...]

What is EPC: 7 day EPC vs 3 month EPC?

Alright so the logic is pretty simple. As I've been trying to find best advertiser who can make me money I got into this situation where I could not understand certain terms. One of them was EPC EPC means Earnings per click and it is generally calculated on the basis of per 100 Clicks. Interesting! I am not sure why they don't call it EP100C or EPHC (Earning per hundred clicks) (these guys are really good) Alright so I tried to sell and you are like Man get to the point :) Alright! lets get back to the point Suppose 3 month EPC for Advertiser Inkjet Superstore is equal to US$42.00 and 7 day EPC for Advertiser Inkject superstore is equal to US$25 The here are you earning results For the past three months, a publisher that means you (because you are publishing their ads) earned US$42 for every 100 clicks (monthly average). And During the past 7 days, a publisher (that means you) earned US$25 for every 100 clicks (daily average). I am an affiliate of above mentioned advertiser So in mathematical terms EPC = Profit ÷ Clicks × 100 Consider the below affiliates from commission junction     By looking at the above screenshot from commission junction, I can see that for the period of the last 3 months, an average payout to GoDaddy affiliates has amounted to $21.53 per every 100 clicks sent to GoDaddy, and for VMWare affiliates, they've been earning an average of $28.08 on every 100 clicks referred for last 7 days. Commission Junction's definition for EPC is as follows Your success is relative to how many visitors you can drive through your site or paid search link that will generate sales for an advertiser you are promoting. EPC does not mean that if someone clicks on that link 100 times you earn the dollar amount in the EPC. Your EPC is calculated in an "apples to apples" comparison with all publishers by taking each publisher's total commissions earned (regardless of currency) and then … [Read more...]

deleting a photo from iCloud photostream associated with iphone ipad ipod

Update: With iOS version 5.1 you can delete individual photographs. Below article only explains steps for iOS < 5.1 on you iPhone and iPad. So if you haven't already then upgrade your iOS to iOS 5.1+ --------------- Jeez that was really mind blowing that you can not do it directly from your iphone or ipad. First thing first. There is no way to delete a single photo in your photo stream.  You will need to reset your photo stream. Alright here are the steps to reset your photo stream Login to your iCloud portal Now Click on your name on the iCloud home page located at the top right corner. If you do not see your name, click the cloud icon in the top left of the page. When you click on your name you will see this dialog window   Now click on the Advanced option on this page. You will see a dialog window as shown below. Now Click on "Reset Photo Stream" button. It will throw an alert so Click ok. (Remember this action will delete all photos in your photo stream) and Once removed, they cannot be recovered, but you can re-upload any photos you'd like to restore to your Photo Stream from your PC or Mac. Now from your iPhone iPad or iPod device, you can remove your photos from the Photo Stream view by turning off Photo Stream and then optionally turning it back to On. You can do this by visiting  Settings > iCloud > Photo Stream. If you added any Photo Stream photos to other albums or the Camera Roll on your iOS device, you can locate and delete these photos manually, if you wish to do so. Please note that you will come across the following message. Don't be scared of this as it will only delete your photo stream not all albums. Once you click on delete photo and switch iCloud photostream setting back to On that's it. You've deleted all your photos and reset your photo stream. I Hope this helps … [Read more...]

custom url for rackspace cloud files CDN

Well the good news is that it is possible to have custom URL for Rackspace cloud files. If you haven't already joined Rackspace Cloud files do so. Now I assume that you already have signed into Rackspace Cloud Files and are ready to roll. First up If you haven't already created a containerin you Rackspace Cloud Files control panel do that. I am going to create a container called images as shown below   After you are done creating your container click on it. You will get some details at the bottom of your portal page as shown below     Your container have got the public URL instantly. Dont forget to Check "Publish to CDN" checkbox. Now I assume that you've got full access to your personal domain. In my case I am going to create a CNAME record for jaspreetchahal.org which points to my CDN public URL which is http://c4900.r0.cf1.rackcdn.com. Man! this URL looks ugly. Now I am using my domain registrar as an example but same steps applies to you too. I logged in to my domain registrar portal and created a CNAME as shown below           This change usually take inbetween few minutes to 1 hour. However, it may take up to 48 hours for these changes to take effect. This time frame is estimate only and not guaranteed. I am speaking from my experiences.   Once every things gets settled try uploading a photo to your newly created container. I did that Here is the ugly URL http://c284900.r0.cf1.rackcdn.com/iRecommend.jpg and here is a good branded URL http://images.jaspreetchahal.org/iRecommend.jpg  It is programatically possible to create containers and upload files. You may be interested in reading my other post on this topic. here is the link for it http://jaspreetchahal.org/how-to-upload-files-to-rackspace-cloud-files-using-php-api-and-get-the-public-url-for-the-uploaded-file/ If you haven't already done that please join Rackspace … [Read more...]

how to: upload files to Rackspace Cloud Files using PHP API and get the public URL for the uploaded file.

Alrighty! So I've joined Rackspace Cloud Files to make like simpler for myself when it comes to "I need more storage" :). To start with let me give you a brief insight on RackSpace Cloud files. First up  First of all in my opinion Rackspace Cloud is far better option than Amazon's offering when it comes to pricing, black listed IP addresses and general speed of your transactions with your Cloud. Cloud Files provides you and your applications unlimited online storage for media – items like backups, video files, or user content. And in an industry first, you can deliver that content to your users at blazing speeds over the market-leading global CDN platform, powered by Akamai Technologies, Inc. Benefits Scalable, dynamic storage. Use as much or little as you want and only pay for what you use. Manage files through their well written and usable online control panel or pro-grammatically through their REST API. Last but not the least: Serve files publicly at blazing speeds through Akamai’s CDN technology. Now said that First thing first you need to join Rackspace Files. Here is the link to join RS Cloud files Its good to know that Cloud Files is tied directly into Akamai’s EdgePlatform so all the uploaded content can be distributed to one of the world’s largest CDN platforms comprised of 84,000+ secure servers deployed in over 72 countries within nearly 1,000 networks. Now the best part Pricing Storage starts at $0.15 per gigabyte. Outgoing bandwidth starts at $0.18 per gigabyte Pay only for what you use. So that now it seems like an interesting bet and you have made up your mind Lets . The reason I am so supportive of Rackspace CF is because of the easy to use API and blazing fast speed when it comes to downloading your content such as images. And I like this line on their website No contracts. No setup fees. Cancel at any time Now if you have all setup by now its time to roll. Download Cloudfiles API … [Read more...]

Google apps where is manage my domain Gmail, Calendar

Alright so when I logged into my Gmail under Google Apps I found out that "Manage my Account" link that used to appear at bottom right corner has disappeared.   Where did it go? Answer: It has been moved under little Gear Icon. There are many instances that Google will change few things here and there and user will feel to ask themselves where did that option go? If there is a massive change to UI of any of their online products then they will offer older version product with the new version of it. This way user can smoothly make a transition form old to new version of their product. Lets me show you where to look for this option  Its shown in the screenshot below   Just so that I know you are on right track, you will only see this option if you are logged in as super user for your Google App. I hope this helps.   Cheers … [Read more...]

Best domain registrar and an excellent DNS hosting provider goes to (for me atleast :))

So recently I've been looking around for good deals because I have few domains to register. I found out that Godaddy is by far the best in terms of Price Order Processing DNS management Easy to use Administrator control panel and much more The other one's are good too but can not beat godaddy on pricing and DNS speed. They run several promotions time to time and I love the discounts that they offer. Amazingly I got one of my domains (.info) for 2 bucks for the first year thats insane. Well I guess it is :). If you would like to purchase cheap domain name click on the link below They also sells cheap SSL certificates which are good for personal websites and also for small to medium business websites. Where else can you get a SSL certificate for 13 bucks an year. They offer the cheapest (As per my research when I was buying mine) wildcard certificates. Check out the link below The premium SSL certificates are also discounted. Checkout the link below One of the website where you can get current discount codes for GodDaddy is http://livecodes.blogspot.com/ You can share your thoughts via comments     … [Read more...]