问题
I'm having similar problem My url is like name.domain.com/subdoamin/store/index.php?...
and my htaccess file is :
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]
however it is giving a 404 Not found
error
回答1:
If your store folder is inside the subdomain folder your RewriteBase should be /subdomain/store/
回答2:
My subdomain resides under root/main site/test site. Under admin->system->setting, you need to provide correct url path. then under .htaccess file this modification worked for me,
RewriteRule ^([^?]*) index.php?route=$1 [L,QSA]
RewriteCond %{REQUEST_URI} !^/testSite/.*$
回答3:
I dug into this and found you have to replace _route_
with route
. This will resolve the issue.
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
--> RewriteRule ^(.*)\?*$ index.php?route=$1 [L,QSA]`
but RewriteBase of subdomain or folder is required.
来源:https://stackoverflow.com/questions/4862691/opencart-htaccess-issue