0

OKボードを検索しましたが、特定の答えが見つかりませんでした。ウェブサイトとショップは同じではありません。Codeigniter はすべての処理に使用されているので、Opencart を使用してショップを追加したいのですが、URI ルーティングが問題です。

(実は私はCIのファンではありませんが、前の人が使っていたので、続けるしかないので、CI沿いにショップを追加する必要があります!)

ウェブサイトをショップから分離し、それぞれをホスト上の個別のフォルダーに配置し、.htaccess 書き換えルールを使用して各 MVC に関連する URI を処理する必要がありますか、それとも簡単なことでしょうか?

4

1 に答える 1

0

CI「システム」フォルダーと同じレベルにフォルダーを作成できるはずで、そこにすべてのショップファイルをコピーできます。次に、domain.com/shop/ からショップにアクセスします。

CI URL から index.php を削除するデフォルトの .htaccess ファイルが既にある場合は、ルーティングや .htaccess ルールを変更する必要はないと思います。私はいくつかのサイトでこれを行っていますが、うまくいきます。

編集:これは、これが正常に機能するサイトの完全な.htaccessファイルです

<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>
于 2010-07-15T09:30:54.380 に答える