Forum Moderators: phranque
This just doesn't seem right (but my experience is minimal with mod_rewrite). Here's my php code for the backend and my htaccess contents if anyone can make sense of this:
$seo_status = $this->globals('khxc_settings.khxc.seo_status');if ((!($print_sid)) && (!($print_portrelay)) && (!($ssllink)) && ($seo_status) && ($seo_paramstatus)) {
$script = preg_replace('/\.php$/','',$url['script']);
$href_url = $url['base_href'] . '/';
$app = (isset($url['params']['app']) ? $url['params']['app'] : 'KHXCseo');
$ns = (isset($url['params']['ns']) ? $url['params']['ns'] : 'KHXCseo');
$ref = (isset($url['params']['ref']) ? $url['params']['ref'] : 'KHXCseo');
$app = urlencode($app);
$ns = urlencode($ns);
$ref = urlencode($ref);
$href_url .= $app . '-' . $ns . '/' . $ref . '.php';
$href_url = preg_replace('/' . $app . '-catshow/','category',$href_url);
$href_url = preg_replace('/' . $app . '-prodshow/','gift',$href_url);
$href_url = preg_replace('/' . $app . '-display/','reference',$href_url);
$href_url = preg_replace('/' . $app . '-prodspec\/KHXCseo.php/','store-specials.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodnew\/KHXCseo.php/','new-products.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodall\/KHXCseo.php/','view-all-products.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodidx\/KHXCseo.php/','product-index.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodbest\/KHXCseo.php/','best-sellers.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodsearch\/KHXCseo.php/','advanced-product-search.php',$href_url);
$href_url = preg_replace('/' . $app . '-contact\/KHXCseo.php/','contact-us.php',$href_url);
$href_url = preg_replace('/' . $app . '-viewcart\/KHXCseo.php/','view-shopping-cart.php',$href_url);
$href_url = preg_replace('/' . $app . '-acctorders\/KHXCseo.php/','order-status.php',$href_url);
$href_url = preg_replace('/' . $app . '-accountmaint\/KHXCseo.php/','account-maintenance.php',$href_url);
$href_url = preg_replace('/' . $app . '-changeemail\/KHXCseo.php/','change-email-address.php',$href_url);
$href_url = preg_replace('/' . $app . '-changepass\/KHXCseo.php/','change-password.php',$href_url);
$href_url = preg_replace('/' . $app . '-addbook\/KHXCseo.php/','address-book.php',$href_url);
$href_url = preg_replace('/' . $app . '-logout_proc\/KHXCseo.php/','account-logout.php',$href_url);
and:
ErrorDocument 404 /404.html
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^category/(.*)\.php index.php?app=ccp0&ns=catshow&ref=$1 [L,PT]
RewriteRule ^gift/(.*)\.php index.php?app=ccp0&ns=prodshow&ref=$1 [L,PT]
RewriteRule ^reference/(.*)\.php index.php?app=ccp0&ns=display&ref=$1 [L,PT]
RewriteRule ^store-specials.php index.php?app=ccp0&ns=prodspec [L,PT]
RewriteRule ^new-products.php index.php?app=ccp0&ns=prodnew [L,PT]
RewriteRule ^view-all-products.php index.php?app=ccp0&ns=prodall [L,PT]
RewriteRule ^product-index.php index.php?app=ccp0&ns=prodidx [L,PT]
RewriteRule ^best-sellers.php index.php?app=ccp0&ns=prodbest [L,PT]
RewriteRule ^advanced-product-search.php index.php?app=ccp0&ns=prodsearch [L,PT]
RewriteRule ^contact-us.php index.php?app=ccp0&ns=contact [L,PT]
RewriteRule ^view-shopping-cart.php index.php?app=ccp0&ns=viewcart [L,PT]
RewriteRule ^order-status.php index.php?app=ccp0&ns=acctorders [L,PT]
RewriteRule ^account-maintenance.php index.php?app=ccp0&ns=accountmaint [L,PT]
RewriteRule ^change-email-address.php index.php?app=ccp0&ns=changeemail [L,PT]
RewriteRule ^change-password.php index.php?app=ccp0&ns=changepass [L,PT]
RewriteRule ^address-book.php index.php?app=ccp0&ns=addbook [L,PT]
RewriteRule ^account-logout.php index.php?app=ccp0&ns=logout_proc [L,PT]
RewriteRule ^(.*)-(.*)/(.*)\.php index.php?app=$1&ns=$2&ref=$3 [L,PT]
Any help is appreciated!
Regards,
James...
Visting many seo-urls, then suddenly a non-seo url (gifts 50 to 100 on line #9):
Click # Timestamp URL visited Duration of Stay
1 Fri May 16 at 11:29:03 PM www.mysite.com 7 seconds
2 Fri May 16 at 11:29:10 PM www.mysite.com/index.php?app=ccp0&ns=prodshow&ref=baby-gift-basket-wild-child-009600&sid=966bymbv28hs59d4oxq7e6xw1445c8u1 9 seconds
3 Fri May 16 at 11:29:19 PM www.mysite.com/category/birthday-gift-baskets.php 6 seconds
4 Fri May 16 at 11:29:25 PM www.mysite.com/gift/birthday-gift-basket-monkey-business-007800.php 10 seconds
5 Fri May 16 at 11:29:35 PM www.mysite.com/gift/gift-basket-cozy-coffee-007600.php 8 seconds
6 Fri May 16 at 11:29:43 PM www.mysite.com/gift/birthday-gift-basket-dinosaurus-007400.php 12 seconds
7 Fri May 16 at 11:29:55 PM www.mysite.com/category/gifts-50-to-100.php 11 seconds
8 Fri May 16 at 11:30:06 PM www.mysite.com/gift/baby-gift-basket-precious-006100.php 12 seconds
9 Fri May 16 at 11:30:18 PM www.mysite.com/index.php?app=ccp0&ns=catshow&ref=gifts-50-to-100&count=20&offset=20 6 seconds
10 Fri May 16 at 11:30:24 PM www.mysite.com/gift/child-gift-basket-little-princess-007500.php 8 seconds
11 Fri May 16 at 11:30:32 PM www.mysite.com/gift/child-gift-basket-happy-day-008000.php 20 seconds
12 Fri May 16 at 11:30:52 PM www.mysite.com/gift/gourmet-gift-baskets-take-a-break-008200.php 8 seconds
13 Fri May 16 at 11:31:00 PM www.mysite.com/index.php?app=ccp0&ns=catshow&ref=gifts-50-to-100&count=20&offset=40 6 seconds
Click # Timestamp URL visited Duration of Stay
1 Sat May 17 at 04:43:25 AM www.mysite.com/category/candy-bouquets.php 1 minute and 11 seconds
2 Sat May 17 at 04:44:36 AM www.mysite.com/index.php?app=ccp0&ns=catshow&ref=candy-bouquets&sid=uy28114j8p1g87818972jioihx46g42q 9 seconds
3 Sat May 17 at 04:44:45 AM www.mysite.com/category/gifts-under-50.php no further activity at this time they hit the seo url for candy bouquets...and then must have clicked on the sidebar link to the same category which ISN'T seo url'd...this just ain't right! I have another cart with seo features and you NEVER see non-seo urls regardless of whether it's your first visit.
James...
There should be no dynamic links at all on any of your pages when you do View->Page source. If there are, then the script or the plug-in needs to be fixed. The links appearing on your pages *define* the URLs, and if they're not 100% static (Search-Engine-friendly), then you've got problems. No amount of mod_rewrite can correct this problem -- The script or the plug-in must be corrected.
Jim
Jim
I know you don't know how the cart code was made so you can't know for sure what's wrong but I was hoping your experience might help in knowing what could be wrong if the urls don't get rewritten because of visiting a non-seo url with an SID...well, can't hurt to ask :)
Thanks,
James...