- 26 Mai 2013, 14:54
#39619
Olá,
Estou usando OC 1.5.5.1.
- Alterei meu .htaccess da pasta root do ocart;
- Criei um .htaccess na pasta admin para a proteger por senha;
- renomeei a pasta admin.
Agora tenho dois problemas:
1) O .htaccess da pasta root me impede de acessar a pasta admin enquanto ela estiver protegida por senha. Se eu remover o .htaccess, eu consigo acessar a página novamente, então eu descobri que tem a ver com minhas regras Rewrite, do .htaccess. Alguém tem alguma ideia de como resolver? Segue o código do .htaccess abaixo:
ANTES:

DEPOIS:

Estou usando OC 1.5.5.1.
- Alterei meu .htaccess da pasta root do ocart;
- Criei um .htaccess na pasta admin para a proteger por senha;
- renomeei a pasta admin.
Agora tenho dois problemas:
1) O .htaccess da pasta root me impede de acessar a pasta admin enquanto ela estiver protegida por senha. Se eu remover o .htaccess, eu consigo acessar a página novamente, então eu descobri que tem a ver com minhas regras Rewrite, do .htaccess. Alguém tem alguma ideia de como resolver? Segue o código do .htaccess abaixo:
Código: Selecionar todos
2) Quando consigo acessar a página de admin, protegida por senha, removendo o arquivo .htaccess, eu recebo uma página mal formatada. Primeiro, não aparecia imagem alguma, daí adicionei umas linhas de código e passou a aparecer uma imagem, mas ainda assim não aparece o botão para efetuar o login. Código:
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
# SEO URL Settings
RewriteEngine On
# If the hostname is NOT www.domain.com
RewriteCond %{HTTP_HOST} !^www\.MEUDOMINIO\.com$
#RewriteCond %{HTTP_HOST} ^www\.(.*)
# 301 redirect to the same resource on www.domain.com
RewriteRule (.*) https://www.MEUDOMINIO.com/$1 [L,R=301]
#DISABLE FILES THAT SHOULD NOT BE ACCESSIBLE
<FilesMatch "(^#.*#|\.(tp|ht|bak|config|dist|fla|inc|ini|log|psd|sh|sql|sw[op])|~)$">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
#HIDE HIDDEN FILES AND FOLDERS
<IfModule mod_rewrite.c>
RewriteCond %{SCRIPT_FILENAME} -d [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule "(^|/)\." - [F]
</IfModule>
#DISABLE FILE LISTING
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /
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]
RewriteCond %{REQUEST_URI} !^/dir/
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]Código: Selecionar todos
Screenshots:RewriteEngine on
RewriteCond ${LeechProtect:/home/fathayde/public_html/Adj2dlASl@2309aoW:%{REMOTE_USER}:%{REMOTE_ADDR}:4} leech
RewriteRule .* https://www.MEUSITE.com
AuthUserFile "/home/fathayde/.htpasswds/public_html/Adj2dlASl@2309aoW/passwd"
AuthType Basic
AuthName "Please log in."
require valid-user
# AS LINHAS ACIMA RESULTAM NA SCREENSHOT "ANTES"
# AS LINHAS ABAIXO RESULTAM NA SCREENSHOT "DEPOIS"
<FilesMatch "\.(png|jpe?g|gif|php)$">
Satisfy Any
Allow from all
</FilesMatch>ANTES:

DEPOIS:


