Jump to content

A Simple Problem: Links redirect away from intended pages


Recommended Posts

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

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

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

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

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

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

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

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

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...