Shopping Cart Operations > Template Support
template error
(1/1)
G. O.:
hello!
how to show website correct? i cannot access the admin panel too.
G. O.:
solution?
I'm using:
php: 8.3
AbanteCart: v.1.4.0
I removed the old .htaccess file as showing and created new one as next here:
# 1. To use URL Aliases you need to be running apache with mod_rewrite enabled.
# 2. In your abantecart main directory rename file htaccess.txt to .htaccess
# 3. Edit file .htaccess. If abantecart is installed in yourdomain/ subfolder change configuration line RewriteBase / to RewriteBase /subfolder/.
# Example: yourdomain.com/store use RewriteBase /store/
# Important to have / at the end of the line.
# 4. if htaccess and mode_rewrite still does not works - check and set apache2 webserver directive AllowOverride All for your virtual hosts
# For any support issues please visit: http://forum.abantecart.com
Options +FollowSymlinks
# Enable mod_rewrite if available
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Prevent Directory Listing
Options -Indexes
# Prevent Direct Access to TPL Files
<FilesMatch "\.tpl">
Order deny,allow
Deny from all
</FilesMatch>
# Disallow Specific Bots
SetEnvIf User-Agent "Googlebot" dontlog
SetEnvIf User-Agent "Bingbot" dontlog
SetEnvIf User-Agent "Slurp" dontlog
CustomLog /dev/null common env=dontlog
# Rewrite section for Retina images based on cookie
RewriteCond %{HTTP_COOKIE} HTTP_IS_RETINA [NC]
RewriteCond %{REQUEST_FILENAME} !@2x
RewriteRule ^(.*)\.(gif|jpg|jpeg|png|webp)$ $1@2x.$2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)@2x\.(gif|jpg|jpeg|png|webp)$ $1.$2
# Ensure Admin Panel URL does not include /om.tr
RewriteCond %{REQUEST_URI} ^/om.tr/admin
RewriteRule ^om\.tr/admin/?(.*)$ /admin/$1 [L,R=301]
# Prevent URL with /om.tr at the beginning
RewriteCond %{REQUEST_URI} ^/om.tr
RewriteRule ^om\.tr/?(.*)$ /$1 [L,R=301]
# SEO URL Settings - Ensure clean URLs for AbanteCart
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
# Redirect directly to the login page if needed
RewriteCond %{REQUEST_URI} ^/admin/?$
RewriteRule ^admin/?$ /index.php?rt=index/login&s=virtualadmin [L,R=301]
</IfModule>
# SITE PERFORMANCE TUNING #
# Enable Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/woff2
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
</IfModule>
# Leverage Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/webp "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
<IfModule mod_headers.c>
Header set Connection keep-alive
<FilesMatch "\.(ico|jpg|jpeg|png|gif|css|swf|webp)$">
Header set Cache-Control "max-age=2678400, public"
</FilesMatch>
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, private, must-revalidate"
</FilesMatch>
<FilesMatch "\.(pdf)$">
Header set Cache-Control "max-age=86400, public"
</FilesMatch>
<FilesMatch "\.(js)$">
Header set Cache-Control "max-age=2678400, private"
</FilesMatch>
</IfModule>
# Redirect requests to robots.txt
RewriteRule ^robots\.txt$ /path/to/robots.txt [L]
after restoring my files through FTP App. to subdomain.mywep.tr now the webpage working fine but on webpage and admin page in the URL automatically added /om.tr on www.subdomain.mywep.tr and become like this: www.subdomain.mywep.tr/om.tr
to solve this i added next code to .htaccess:
# Ensure Admin Panel URL does not include /om.tr
RewriteCond %{REQUEST_URI} ^/om.tr/admin
RewriteRule ^om\.tr/admin/?(.*)$ /admin/$1 [L,R=301]
# Prevent URL with /om.tr at the beginning
RewriteCond %{REQUEST_URI} ^/om.tr
RewriteRule ^om\.tr/?(.*)$ /$1 [L,R=301]
on webpage now looking fine but on admin panel page i cannot access although every thing is correct and there is no error logs.
what shall i do?
Basara:
Hello.
Please use default htaccess rules from https://raw.githubusercontent.com/abantecart/abantecart-src/refs/heads/1.4.1/public_html/.htaccess.txt
If you encounter any issues with the htaccess rules or find them incompatible with your server, try removing them block by block and testing each time. Additionally, you can contact your hosting support for assistance with htaccess compatibility.
Lastly, ensure that the URL you use to visit your store matches the store URL set in your AbanteCart admin. https://abantecart.atlassian.net/wiki/spaces/AD/pages/5832828/Store+URLs+SSL
G. O.:
--- Quote from: Basara on November 25, 2024, 02:28:26 AM ---Hello.
Please use default htaccess rules from https://raw.githubusercontent.com/abantecart/abantecart-src/refs/heads/1.4.1/public_html/.htaccess.txt
If you encounter any issues with the htaccess rules or find them incompatible with your server, try removing them block by block and testing each time. Additionally, you can contact your hosting support for assistance with htaccess compatibility.
Lastly, ensure that the URL you use to visit your store matches the store URL set in your AbanteCart admin. https://abantecart.atlassian.net/wiki/spaces/AD/pages/5832828/Store+URLs+SSL
--- End quote ---
hello,
thanks for taking time and reply. I created a new htaccess code with next blocks and finally my website links worked fine:
--- Code: ---# 1. To use URL Aliases you need to be running apache with mod_rewrite enabled.
# 2. In your abantecart main directory rename file htaccess.txt to .htaccess
# 3. Edit file .htaccess. If abantecart is installed in yourdomain/ subfolder change configuration line RewriteBase / to RewriteBase /subfolder/.
# Example: yourdomain.com/store use RewriteBase /store/
# Important to have / at the end of the line.
# 4. if htaccess and mode_rewrite still does not work - check and set apache2 webserver directive AllowOverride All for your virtual hosts
# For any support issues please visit: https://forum.abantecart.com
Options +FollowSymlinks
# Prevent Directory Listing
Options -Indexes
# Allow Symlinks for Clean URLs
Options +FollowSymlinks
# Prevent Access to Hidden Files (e.g., .git, .htaccess)
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
# Prevent Direct Access to Template Files
<FilesMatch "\.tpl$">
Order deny,allow
Deny from all
</FilesMatch>
# Block Specific URL Pattern (/om.tr) Except Admin Login
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/om\.tr [NC]
RewriteCond %{QUERY_STRING} !rt=index/login [NC]
RewriteRule ^om\.tr/?(.*)$ /$1 [L,R=301]
# SEO URL Settings
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
# Retina Images Handling
RewriteCond %{HTTP_COOKIE} HTTP_IS_RETINA [NC]
RewriteCond %{REQUEST_FILENAME} !@2x
RewriteRule ^(.*)\.(gif|jpg|jpeg|png|webp|avif)$ $1@2x.$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)@2x\.(gif|jpg|jpeg|png|webp|avif)$ $1.$2 [L,QSA]
# Compression for Performance
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript
</IfModule>
# Browser Caching for Improved Load Speed
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/javascript "access 1 month"
</IfModule>
# Cache Control Headers
<IfModule mod_headers.c>
Header set Connection keep-alive
<FilesMatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf|webp|avif)$">
Header set Cache-Control "max-age=2678400, public"
</FilesMatch>
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, private, must-revalidate"
</FilesMatch>
<FilesMatch "\.(pdf)$">
Header set Cache-Control "max-age=86400, public"
</FilesMatch>
<FilesMatch "\.(js)$">
Header set Cache-Control "max-age=2678400, private"
</FilesMatch>
</IfModule>
--- End code ---
Navigation
[0] Message Index
Go to full version