2

我有类似的问题我的网址就像 name.domain.com/subdoamin/store/index.php?...

我的 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错误

4

3 回答 3

2

如果您的商店文件夹位于子域文件夹中,您的RewriteBase应该是/subdomain/store/

于 2011-02-13T04:06:07.000 回答
1

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

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

RewriteCond %{REQUEST_URI} !^/testSite/.*$

于 2017-04-17T07:11:00.773 回答
0

我对此进行了深入研究,发现您必须替换_route_route. 这将解决问题。

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

但需要子域或文件夹的 RewriteBase。

于 2011-10-13T09:06:01.437 回答