jamiedickinson Posted November 15, 2010 Share Posted November 15, 2010 I am having a problem that my merchant bank (Barclaycard) will only accept orders from http://WWW.webaddress.com, but sometimes people visit http://webaddress.com without the WWW, is there anyway to force the customers browser to automatically redirect to WWW when it gets to the order.php stage?Jamie Link to comment Share on other sites More sharing options...
jhnstcks Posted November 15, 2010 Share Posted November 15, 2010 Yes you need to add this code to the bottom of the htaccess file. Options +FollowSymlinks rewritecond %{http_host} ^yourdomain.co.uk [nc] rewriterule ^(.*)$ http://www.yourdomain.co.uk/$1 [r=301,nc] This will also help with SEO as address with and without www. are considered to be 2 different sites. Link to comment Share on other sites More sharing options...
jamiedickinson Posted November 15, 2010 Author Share Posted November 15, 2010 Thank you so much for getting back to me - this seems to work fab!I have changed rewriterule ^(.*)$ http://www.yourdomain.co.uk/$1 [r=301,nc] to rewriterule ^(.*)$ http://www.yourdomain.co.uk/webstore$1 [r=301,nc] as the site is technically 'www.websiteaddress.co.uk/webstore/' I hope this won't affect anything! Thanks again!!Jamie Link to comment Share on other sites More sharing options...
Allabouthemoney Posted March 24, 2011 Share Posted March 24, 2011 Hello,I've already tried your suggestion but still doesn't work. (I've put the code right to the bottom of the document )Do you have any other suggestions? Link to comment Share on other sites More sharing options...
jamiedickinson Posted March 24, 2011 Author Share Posted March 24, 2011 Add it to your .htaccess file not to the php file. Link to comment Share on other sites More sharing options...
Allabouthemoney Posted March 25, 2011 Share Posted March 25, 2011 That's what I did...I've added it to the .htacces file right at the bottom this lines of code were the last ones on the file.but as I said it doesn't work for me Chrome is showing Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.(I've already deleted the cookies) Link to comment Share on other sites More sharing options...
jamiedickinson Posted March 25, 2011 Author Share Posted March 25, 2011 What else is in the htaccess file? Link to comment Share on other sites More sharing options...
Allabouthemoney Posted March 25, 2011 Share Posted March 25, 2011 This is how the .htaccess file looks like without the inserted code above:# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE# http://www.prestashop.com - http://www.prestashop.com/forums# URL rewriting module activationRewriteEngine onRewriteCond %{HTTP_HOST} ^e-bookdepository.netRewriteRule ^(.*)$ http://www.e-bookdepository.net/$1 [R=301,L]# URL rewriting rulesRewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L]RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2$3.jpg [L]RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2.jpg [L]RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L]RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$1 [QSA,L]RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*) /supplier.php?id_supplier=$1 [QSA,L]RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*) /manufacturer.php?id_manufacturer=$1 [QSA,L]RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$1 [QSA,L]RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [QSA,L]RewriteRule ^page-not-found$ /404.php [QSA,L]RewriteRule ^address$ /address.php [QSA,L]RewriteRule ^addresses$ /addresses.php [QSA,L]RewriteRule ^authentication$ /authentication.php [QSA,L]RewriteRule ^best-sales$ /best-sales.php [QSA,L]RewriteRule ^cart$ /cart.php [QSA,L]RewriteRule ^contact-us$ /contact-form.php [QSA,L]RewriteRule ^discount$ /discount.php [QSA,L]RewriteRule ^guest-tracking$ /guest-tracking.php [QSA,L]RewriteRule ^order-history$ /history.php [QSA,L]RewriteRule ^identity$ /identity.php [QSA,L]RewriteRule ^manufacturers$ /manufacturer.php [QSA,L]RewriteRule ^my-account$ /my-account.php [QSA,L]RewriteRule ^new-products$ /new-products.php [QSA,L]RewriteRule ^order$ /order.php [QSA,L]RewriteRule ^order-follow$ /order-follow.php [QSA,L]RewriteRule ^quick-order$ /order-opc.php [QSA,L]RewriteRule ^order-slip$ /order-slip.php [QSA,L]RewriteRule ^password-recovery$ /password.php [QSA,L]RewriteRule ^prices-drop$ /prices-drop.php [QSA,L]RewriteRule ^search$ /search.php [QSA,L]RewriteRule ^sitemap$ /sitemap.php [QSA,L]RewriteRule ^stores$ /stores.php [QSA,L]RewriteRule ^supplier$ /supplier.php [QSA,L]# Catch 404 errorsErrorDocument 404 /404.php ExpiresActive On ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 week" ExpiresByType text/javascript "access plus 1 week" ExpiresByType application/javascript "access plus 1 week" ExpiresByType application/x-javascript "access plus 1 week" ExpiresByType image/x-icon "access plus 1 year"FileETag INode MTime Size AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript Link to comment Share on other sites More sharing options...
jamiedickinson Posted March 25, 2011 Author Share Posted March 25, 2011 There is already a 301 redirection in the file from Prestashop: RewriteRule ^(.*)$ http://www.e-bookdepository.net/$1 [R=301,L]Depending on what you want to do you will have to overwrite that one.Alternatively if you wanted to redirect anyone who went on www.e-bookdepository.net/store to go to www.e-bookdepository.net, create a folder called store and add your own .htaccess file with just the original redirect link above. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now