Heinyken Posted September 28, 2011 Share Posted September 28, 2011 Hello, My (dev) site: http://chc.vonrocko.com/ This is a custom design and I've coded the links in the header bar to go to where they belong, whether external or CMS pages, and I've activated SEO-friendly permalinks and updated my .htaccess file. The link to what should be the customer's account: (chc.vonrocko.com/my-account.php) redirects to a strange 404: (chc.vonrocko.com/authentication?back=my-account.php), and I'm really not sure why. Also, I cannot add items to my shopping cart, instead I get redirected to (chc.vonrocko.com/cart), which receives a 404. Please halp! Link to comment Share on other sites More sharing options...
Heinyken Posted September 29, 2011 Author Share Posted September 29, 2011 The problem is definitely with my Preferences->SEO & URLs setting: Friendly URL. If Friendly URL is "on" -- I cannot add products to shopping bag. Link to comment Share on other sites More sharing options...
oxyweb Posted September 29, 2011 Share Posted September 29, 2011 Very nice theme Try switching of Friendly URL, regenerate your htaccess, test you can still access the pages, then switch on friendly, and regenerate htaccess file... wait a few seconds before testing again. If that doesn't work, delete your htaccess file manually first and don't forget to delete your cache especially in Firefox since it does crazy things sometimes. Link to comment Share on other sites More sharing options...
Heinyken Posted September 29, 2011 Author Share Posted September 29, 2011 Thanks, I'm just the coder, but I'll pass it along to my designer =D That's more or less what I've been doing. It's not that the cart doesn't exist. And when I do de-activate the friendly URLs, I can get to the cart. The problem is that the client is probably going to want SEO-friendly URLs. Does some part of my theme need to be differently coded to allow for redirection? Or is it just the .htaccess that does the URLs and redirection? Thanks for taking the time to respond! -Ross Link to comment Share on other sites More sharing options...
oxyweb Posted September 29, 2011 Share Posted September 29, 2011 If my solutions work then friendly urls will be on. Can you switch friendly urls back on so I can test again as at present i am getting to /order.php AFAIK the htaccess takes care of all the redirects - that's part of its job Link to comment Share on other sites More sharing options...
oxyweb Posted September 29, 2011 Share Posted September 29, 2011 I see the error page now. Is your cart page called cart.php or cart.html in your htaccess file? RewriteRule ^cart$ /cart.php Link to comment Share on other sites More sharing options...
Heinyken Posted September 29, 2011 Author Share Posted September 29, 2011 Sorry, I've been switching it on and off -- didn't see your posts. Hope I wasn't confusing you =D I think these are the two rules that are offending: RewriteRule ^authentication$ /authentication.php [QSA,L] RewriteRule ^cart$ /cart.php [QSA,L] Link to comment Share on other sites More sharing options...
Heinyken Posted September 29, 2011 Author Share Posted September 29, 2011 I'm still not totally certain how Smarty parses the theme files - could the redirection problem derive from the fact that in my theme folder the shopping cart (cart.php) template file is actually "shopping-cart.tpl"? Link to comment Share on other sites More sharing options...
oxyweb Posted September 29, 2011 Share Posted September 29, 2011 I think I know what the filename issue is If I visit http://chc.vonrocko....e536c037b9fcf66 I get a 404 error If I visit http://chc.vonrocko.com/cart.php?Submit=Add%20to%20cart&add=1&id_product=14&id_product_attribute=&qty=1&token=a67996495ea6b3cece536c037b9fcf66 I get the Shopping cart Summary. are you calling your cart page cart.html? Back Office Preferences > SEO & URLs may not like it. I think so anyway. Apologies if you've already thought of this! Edit: I'm not sure on your question about the Smart Template but I do also have a shopping-cart.tpl in my theme - not 100% what it actually does! Link to comment Share on other sites More sharing options...
Heinyken Posted September 29, 2011 Author Share Posted September 29, 2011 Hm. I actually hadn't thought of that, but there isn't anywhere that I'm calling cart.html. In fact, all the links go to either order.php or my-account.php, the cart.php (or not .php!) comes about from the templating, I think. Link to comment Share on other sites More sharing options...
oxyweb Posted September 29, 2011 Share Posted September 29, 2011 This is intriguing. So now... cart.php sows a 302 temp move (i'm pretty sure it's meant to do that but then I end up with this page http://chc.vonrocko....der?ipa=14 which failes with a 404 (no idea what that ipa=14 is). Again if I do http://chc.vonrocko....rder.php?ipa=14 it's fine. So erm back to the drawing board? Link to comment Share on other sites More sharing options...
Heinyken Posted September 29, 2011 Author Share Posted September 29, 2011 Holy crap! Augh. I have no idea. It seems it's working alright without the SEO-friendly URLs, so I may just have to explain it that it's not going to work out. Do you know the difference between the Preferences->SEO & URLs option to turn on friendly urls versus Tools->Generators option? The Generators' option simply makes it possible to SEO-friendly in the .htaccess, but the Preferences actually turns it on, right? Redirecting to canonical urls doesn't seem to affect the site like SEO-friendly does. indeed... Link to comment Share on other sites More sharing options...
oxyweb Posted September 29, 2011 Share Posted September 29, 2011 in SEO & URLS delete the cart.php & orders.php options to at least keep some of the friendly urls. I think canonical indexes http://www.blah..com/myorder?session=dsd33d3n8nf2fas as just http://www.blah..com/myorder. I think. I think it's seperate to Friendly URL. Link to comment Share on other sites More sharing options...
Heinyken Posted September 29, 2011 Author Share Posted September 29, 2011 in SEO & URLS delete the cart.php & orders.php options to at least keep some of the friendly urls. Do you mean actually delete those pages from the list of pages that gets displayed at Back Office->Preferences->SEO & URLs? I don't know PS well enough to say for certain, but wouldn't that be... not good? Link to comment Share on other sites More sharing options...
oxyweb Posted September 29, 2011 Share Posted September 29, 2011 Yes but you can always re-add them! All it does is send anyone visiting /cart.php to /cart but of course we know that creates a 404 error anyway. You will need to regenerate the htaccess file. Link to comment Share on other sites More sharing options...
oxyweb Posted September 29, 2011 Share Posted September 29, 2011 Incidentally, this is what my htaccess file looks like (just for reference). I've made no changes to my actual seo files. # .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 <IfModule mod_rewrite.c> # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L] RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$1$2.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L] RewriteRule ^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$ /img/c/$1.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 ^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [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] </IfModule> # Catch 404 errors ErrorDocument 404 /404.php <IfModule mod_expires.c> 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" </IfModule> FileETag INode MTime Size <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript </IfModule> 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