Opencart .htaccess 问题
我遇到了类似的问题我的网址类似于 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 find
错误
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您的商店文件夹位于子域文件夹内,您的RewriteBase应该是/subdomain/store/
If your store folder is inside the subdomain folder your RewriteBase should be /subdomain/store/
我的子域位于根/主站点/测试站点下。
在管理->系统->设置下,您需要提供正确的 url 路径。
然后在 .htaccess 文件下,此修改对我有用,
RewriteRule ^([^?]*) index.php?route=$1 [L,QSA]
RewriteCond %{REQUEST_URI } !^/testSite/.*$
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/.*$
我对此进行了深入研究,发现您必须将
_route_
替换为route
。这将解决该问题。但需要子域或文件夹的RewriteBase。
I dug into this and found you have to replace
_route_
withroute
. This will resolve the issue.but RewriteBase of subdomain or folder is required.