2011-02-01 133 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}!^ /測試網站/.*$