views:

21

answers:

1

OK I searched the boards and could not found any specific answer. the website and the shop aren't the same. Codeigniter has been used for handling everything so now I want to add a shop using Opencart and the URI routing is the problem.

(The truth is Im not a CI fan but since the guy before me used it I have no other choice but to continue and now I have to add a shop along CI!)

Should I separate the website from the shop and put each one into a separate folder on the host and use .htaccess rewrite rules to handle URI related to each MVC or can I do something simple?

A: 

You should be able to create a folder at the same level of your CI "system" folder and in there you can copy all the shop files. You then just access the shop via domain.com/shop/

I don't think you need to change any routing or .htaccess rules if you already have the default .htaccess file in place that removes index.php from the CI urls. I'm doing this on several sites and it works fine.

EDIT: here is my full .htaccess file for a site where this works fine

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /    

    redirect 301 /disclaimer/disclaimer.html /disclaimer.html

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    #special rule to allow the 301 redirect from above
    RewriteCond %{REQUEST_URI} !disclaimer/disclaimer.html$ 

    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>



<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

#####################################################
# CONFIGURE media caching
#
Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2012 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>
#
#####################################################

<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
stef
Now that you mention, the guy before me seems to work it out by not putting .htaccess file there and there's no index.php in the URIs....he must have done the hard ways...ok lets try this...I put the .htaccess and see if we're missing something here....will be back
Dreamee
nope..it doesnt work.....Im going crazay!
Dreamee
See the contents of my .htaccess file. What errors are you getting?
stef