我安装了锂电池,所有的.htaccess都工作正常。
我需要在app/webroot/ OpenCart中安装购物车
我复制了所有文件,还将锂安装的根文件夹中的.htaccess文件更改为
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule shop/(.*) /app/webroot/shop/$1 [L]
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
不过,当我浏览http://domain.com/shop时,它会将我带到http://domain.com/app/webroot/shop/
在页面上出现错误:
Exception
lithium\action\DispatchException (code 404)
Action `webroot` not found.
请帮我解决这个问题。
发布于 2013-03-29 17:24:06
您可以尝试执行以下操作:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/app/webroot/shop/? [NC]
RewriteRule ^shop/(.*) /app/webroot/shop/$1 [L,NC]
RewriteCond %{REQUEST_URI} !/app/webroot/? [NC]
RewriteRule ^$ /app/webroot/ [L,NC]
RewriteCond %{REQUEST_URI} !/app/webroot/? [NC]
RewriteRule ^(.*) /app/webroot/$1 [L,NC]
</IfModule>
发布于 2013-05-13 04:48:39
问题是,你的最后一个“全部捕获”规则也将商店的所有请求重定向到锂,这是你不想要的。
尝尝这个
Options +FollowSymlinks -MultiViews
RewriteEngine On
# Rewrite all URLs that start with /shop to /app/webroot/shop
RewriteRule ^shop/.? /app/webroot/shop%{REQUEST_URI} [L]
# Rewrite all URLs that don't start with /app/webroot/shop to /app/webroot
RewriteCond %{REQUEST_URI} !^/app/webroot/shop
RewriteRule .? /app/webroot%{REQUEST_URI} [L]
https://stackoverflow.com/questions/15698986
复制相似问题