Jump to content

302 Redirect


serv0

Recommended Posts

I am running prestashop 1.5.4.0

 

I found my shop is giving a 302 "Temporary" redirect which is causing some issues with SEO efforts. 

When looking in my cpanel it is showing that the following is causing the 302 redirect which it should instead be a 301.

 

Domain                  Directory          Redirect URL                                           Type

mydomain.com           /                  %{ENV:REWRITEBASE}index.php           temporary

 

 

After finding this in .htaccess and adding R=301 every link on my site just goes to the homepage

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
 
Anyone have this issue before and know how I can get my site to stop redirecting as 302 and redirect as a 301 instead. 
 
I have in my shop seo&url to use www
so when typing the url mydomain.com it  is redirecting to http://www.mydomain.com
 
Let me know if you would like me to post my full .htaccess file 
 
I am using this site to check the header
Link to comment
Share on other sites


# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution

# http://www.prestashop.com - http://www.prestashop.com/forums

 

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule . - [E=REWRITEBASE:/]

RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

 

# Images

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1-$2$3$4.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9]+)\-([0-9]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1-$2$3.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]

# AlphaImageLoader for IE and fancybox

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

 

# Dispatcher

 

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^.*$ - [NC,L]

RewriteCond %{HTTP_HOST} ^www.mydreamsarees.com$

RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]

 

 

</IfModule>

 

#If rewrite mod isn't enabled

ErrorDocument 404 /index.php?controller=404

 

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

Link to comment
Share on other sites

Thank you!

Nothing wrong with your htaccess.

 

Did you buy your domain name along with your shared hosting? I mean did you use the same company or you bought your domain and your shared hosting separately?

 

I quite sure that your non-www to www is handled by your hosting admin or registrar. You need to take a look to your administration and and modify the type of redirection to 301.

 

By the way which registrar are you using? or hosting company?

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...