我有一个网站,主要是基于代码igniter.Inside,我有一个商店设置使用opencart.Everything工作良好,直到我尝试使用opencart搜索引擎友好的urls。
完成后,它将显示代码点火器404视图。
当url为xyz.com/store时,如何绕过CI路由?
我的Htaccess文件在这里:
# Customized error messages.
ErrorDocument 404 index.php
# Set the default handler.
DirectoryIndex index.php
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.(.*)
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>发布于 2015-09-24 08:09:15
这个问题可能是在您的.htaccess文件中引起的。默认的Codeigniter .htaccess文件被设置为将所有通信量路由到您的公共目录index.php。为了防止这种情况,您需要设置一个RewriteCond,以排除您希望保持在代码点火器之外的任何目录。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(store[^/]*)$
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
RewriteCond %{HTTP_HOST} !^www\.(.*)
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>https://stackoverflow.com/questions/32754982
复制相似问题