Category » Apache

Magento: After “Use Web Server Rewrite” is set to yes, home page loads but other pages give 404 error.

404 Error

To remove index.php from the Urls in Magento, I enabled web server rewrites from Magento admin. I cleared the Magento cache and refreshed the home page. The home page loaded well and index.php was removed from all the links on home page but when I clicked link on any home page it gave me 404 error.  If I added index.php to the page URL in browser manually it loaded well. I had Apache running on Ubuntu.

Continue reading »

Redirect your website users to your preferred URL, either WITH or WITHOUT the ‘www.’ prefix


If your website can be accessed with and without www then its considered having duplicate pages. If you have ever integrated the “facebook like” button on your website pages, try accessing the page with www and without www; you will notice different like counts displayed on the pages.

To prevent these duplicate pages on your website, you can redirect non-WWW traffic to WWW or vice-versa using mod_rewrite in your .htaccess file.

Continue reading »

Force Files to Download Instead of Showing Up in the Browser

curl vs wget

Sometimes you may have noticed that when you click on a download link, the file shows up in one browser while in some other browser it gets downloaded. Internet Explorer will usually try to show Microsoft Word files (doc and docx) in the browser, while most other browsers will download it.

If the browser supports a file it shows up the file else it downloads the file. Image files like png, gif, jpg almost always show in the browser. Archive files like zip, tar, and gzip almost are always downloaded.

Continue reading »

Creating Virtual Hosts

Virtual Hosting is a method of hosting multiple websites (domain names like, etc) on a single server. There are two main types of virtual hosting, name based and IP based.

        • “name-based”: We have multiple names running on each IP address. It is sometimes also called host-based or non-IP virtual hosts.


        • “IP-based”: We have a different IP address for every web site

Continue reading »

Back to top