AbanteCart Community

eCommerce construction => How-to questions => Topic started by: hislordship on May 24, 2018, 05:13:51 AM

Title: Permanent Redirect Issues
Post by: hislordship on May 24, 2018, 05:13:51 AM
Hello

This is a new problem I'm having, never was an issue on Zencart so I am puzzled.

I want to redirect a specific URL for newsletter signups as follows:
tjn.co.za/newsletter => eepurl.com/cHBk

Done the redirect as a permanent redirect in CPanel but it doesn't work. I always end up at my Abantecart site with the error page.

Any suggestions?
Title: Re: Permanent Redirect Issues
Post by: Basara on May 24, 2018, 06:27:04 AM
Redirects in cPanel absolutely not related to AbanteCart.
Ask your hosting support to help you
Title: Re: Permanent Redirect Issues
Post by: hislordship on June 08, 2018, 05:54:13 AM
Thank you for the reply.

My hosting company has replied as follows:

The difference from trophyjunction.co.za would be abantecart .htaccess rules present in tjn.co.za.
This seems to be disrupting the re-writes rules for newsletter redirect to mailchimp url.
You might have to consult a developer or abantecart support to resolve the apparent redirect conflict.
Title: Re: Permanent Redirect Issues
Post by: hislordship on June 08, 2018, 06:21:16 AM
.htaccess file is as follows:

# 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

# Prevent Directory listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "\.tpl">
Order deny,allow
Deny from all
</FilesMatch>

RewriteEngine on

# Rewrite section for retina high-res images with @2x in the end of filename base on cookie HTTP_IS_RETINA
# To emulate Retina mode on your NON-Retina display, add HTTP_IS_RETINA cookie in your browser
RewriteCond %{HTTP_COOKIE} HTTP_IS_RETINA [NC]
RewriteCond %{REQUEST_FILENAME} !@2x
RewriteRule ^(.*)\.(gif|jpg|jpeg|png)$ $1@2x.$2
# if @2x isn't available fulfill the original request
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)@2x\.(gif|jpg|jpeg|png)$ $1.$2

# SEO URL Settings
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]

# SITE PERFORMANCE TUNING #
# Browser Caching, Compression and Headers cache control
# This is to manage browser cache and improve site loading
# NOTE: If you do active development disable this as you will need to clear your browser cache manually

# Enable Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
</IfModule>
<IfModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
# Leverage Browser Caching
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access 1 year"
  ExpiresByType image/jpeg "access 1 year"
  ExpiresByType image/gif "access 1 year"
  ExpiresByType image/png "access 1 year"
  ExpiresByType text/css "access 1 month"
  ExpiresByType text/html "access 1 month"
  ExpiresByType application/pdf "access 1 month"
  ExpiresByType text/x-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|flv|jpg|jpeg|png|gif|css|swf)$">
  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>
RewriteCond %{HTTP_HOST} ^tjn\.co\.za$ [OR]
RewriteCond %{HTTP_HOST} ^www\.tjn\.co\.za$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^newsletter$ "http\:\/\/eepurl\.com\/cHBk" [R=301,L]

Title: Re: Permanent Redirect Issues
Post by: Sam_78 on June 08, 2018, 09:14:25 AM
you can edit your .htaccess add one line at the bottom here
# SEO URL Settings
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html

301 is permanent redirect and if you don't want that then remove 301.

general syntax is
Redirect /oldpage /newpage

Try this