Opencart .htaccess issue

戏子无情 提交于 2020-01-02 08:58:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!