Friday, November 30, 2012

Excluding Directories From Open Cart - Edit .htaccess

Hi, Everyone,

I am working with Open Cart  now a days and there are many things needed be taken care of, for example I had an issue with Open Cart taking over my server :) and since I am using Friendly SEO URLs e.g. etc. this creates a situation when you have installed open cart on the root of your website "It does not let you access new sub-directories you create" so, the solution is to edit the .htaccess file on the root of your server and follow these steps;

1- Open your ".htaccess" file in a Text Editor or Dreamweaver
2- Find the line "RewriteBase /"
3- Just under this line add a new line of code "RewriteRule ^/directory-name [L]" Where "directory-name" is the name of your own directory you have already created on the server via FTP or File Manager etc.

Now when you access this newly created directory, it'll still show the Open Cart page with "Page Not Found" error, this is because open cart has put a custom 404 Page on your server, to get rid of this situation you'll have to upload an Index file (index.html, index.htm or index.php etc.) to access the directory.

I have created a custom directory on the client server to show this function; here it shows the index.html file free from the clutches of Open Cart, I believe the same solution can be applied to Word Press or other software that use .htaccess and URL Rewrite Module to present SEO Friendly or User Friendly URLs.

I applied this solution to Open Cart 1.5.4

Thanks & Enjoy !
I.Q !


  1. Wonderful Design Blogs, Such a great list. Thanks for sharing all these blogs all are very useful to every one.
    opencart development
    opencart developer

  2. Dear Iqtidar Ali,

    I've done everything you suggested, but when i'm trying to reach a subdirectory Opencart still comes up with the custom 404 page. Even when i direct to url/directory/index.php

    What else could be the problem?

    1. hmmm.... try to upload index.html instead of index.php and check... post your .htaccess file here, I can look.

  3. Hey thanks for updating on Excluding Directories From Open Cart. This was really helpful for me.
    OpenCart Development Customization

  4. Well connected to Major Expressway such as Pan-Island Expressway (PIE) and Central Expressway (CTE) to get you to places in no time.

  5. Thank you sharing this information thank you.Come back again for more interesting stuffs like one you got earlier! Bulk SMS in India

  6. Thanks so much for this helpful information come back again for more interesting information…Keep it up
    Builders in Agra


Please post your thoughts :)