.htaccess exclude子目录

时间:2015-12-01 03:33:55

标签: .htaccess

我有以下opencart .htaccess:

Options +FollowSymlinks
Options -Indexes

<FilesMatch "\.(tpl|ini|log)">
 Order deny,allow
 Deny from all
</FilesMatch>

RewriteEngine On

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteRule ^image-smp/(.*) index.php?route=product/smp_image&name=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

我目前正在更换以前在x-cart中的旧商店。我把它移到了:

example.com/old/

我尝试做的是在用户访问时仍然可以访问此旧商店:

 example.com/old/ or example.com/old/admin/

(原因还有一些旧的客户订单需要处理。) 主要问题是,当我转到那些网址时,根.htaccess会覆盖这些网址,并提供opencart 404页面。

任何人都知道如何篡改htaccess以使两个CMS在同一个域上运行?

1 个答案:

答案 0 :(得分:0)

发现问题。当前设置将读取html和php页面(如果存在),否则根htaccess中设置的规则将生效。我无法让文件工作的原因是因为权限,这最终导致我花费了相当多的时间修修补补。

对于登陆此页面的未来人员,请确保将目录权限设置为755,将文件权限设置为644.

目录:

 find /path/to/base/dir -type d -exec chmod 755 {} +

For Files:

find /path/to/base/dir -type f -exec chmod 644 {} +