Memorial day is 05/25/2015 – Orders will ship out on May 26th. There will not be any deliveries or shipping on Monday. Any order placed after 11am ET on Friday May 22nd will not start to ship out until Tuesday May 26th.

ZenCart - Shorten URLs Tutorial Tweaks
Moderators: adafruit_support_bill, adafruit

Forum rules
Get help, and assist others in with open source kits and running a business! Do not ask for legal advice or for consulting services in this forum, only general biz questions!

ZenCart - Shorten URLs Tutorial Tweaks

by presence on Sat Feb 18, 2012 9:53 pm

I've slipped together a stock ZenCart 1.5.0 installation and the "Shorten and Pretify URLs" tutorial easily, but ran into a minor hangup.
Tutorial at:

ZenCart's links for "All Products" and "New Products" are created nicely with the code modification in includes/functions/html_output.php
The bummer is that the tutorial's current .htaccess rewrite example doesn't translate the nice short & simple "New" and "All" links back into ZenCartian.

Copypasta these additional lines into .htaccess and all seems peachy:
Code: Select all | TOGGLE FULL SIZE
#redirect old products_all
RewriteCond %{QUERY_STRING} ^main_page=products_all$
RewriteRule ^index.php$ /all? [R=301]

#redirect old products_new
RewriteCond %{QUERY_STRING} ^main_page=products_new$
RewriteRule ^index.php$ /new? [R=301]

#rewrite back to the old page
RewriteRule ^all/ index.php?hidden=yes&main_page=products_all [QSA,L]
RewriteRule ^new/ index.php?hidden=yes&main_page=products_new [QSA,L]

Think that's all there was to it, but if anyone has suggestions to make more efficient or any other .htaccess rewrites that help ZenCart along, please share!

Posts: 11
Joined: Wed Apr 29, 2009 8:37 pm
Location: Las Vegas, NV