2011-02-01 132 views
2

我有类似的问题,我的网址是像name.domain.com/subdoamin/store/index.php ...Opencart的问题的.htaccess

和我的htaccess文件是:

Options +FollowSymlinks 

# Prevent Directoy listing 
Options -Indexes 

# Prevent Direct Access to files 
<FilesMatch "\.tpl"> 
Order deny,allow 
Deny from all 
</FilesMatch> 

#<FilesMatch "\.ini"> 
#Order deny,allow 
#Deny from all 
#</files> 

# SEO URL Settings 
RewriteEngine On 
RewriteBase /store/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
#RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA] 
RewriteRule ^(.*) index.php [L,QSA] 

但它是给人一种404 Not found错误

+0

类似的问题是什么? – random 2011-03-19 21:15:15

回答

2

如果你的存储文件夹是子域文件夹RewriteBase里面应该是/子/存储/

0

我挖掘到这里,发现你必须用route替换_route_。这将解决问题。

RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA] 
--> RewriteRule ^(.*)\?*$ index.php?route=$1 [L,QSA]` 

但RewriteBase的子域或文件夹是必需的。

+1

那实际上并不正确。 `_route_`需要重写的URL才能被解码 – 2012-11-09 16:22:27

1

我的子域驻留在根/主站点/测试站点下。 在admin-> system->设置下,您需要提供正确的url路径。 然后在.htaccess文件这个修改对我有效,

RewriteRule ^([^?] *)index.php? 路线 1 = $ [L,QSA]

的RewriteCond%{REQUEST_URI}!^ /测试网站/.*$