You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hello,
Still setting up site at http://www.linuxcdshop.com/index.php
I am slowly trying to rid the urls of any reference other than what is specific to my site.
I have managed to get rid of the ref to KHXCseo.html It was a simple task. Go to your KHXC_Display.php file and search for "KHXCseo" and there are 3 references to this. I just replaced it with the word "index".
Now....
I am try to rid myself of the other references like:
ccp0-prodspec
ccp0-prodnew
ccp0-prodbest
ccp0-prodsearch
ccp0-prodall
ccp0-prodidx
I would also like to get rid ofthese references:
ccp0-catshow
ccp0-prodshow
If anyone can help point me to correct files and so on that would be much appreciated.
Mainly I want to remove ccp0 - part of the above and rename
Offline
Update: IGNORE THIS POST SEE POST BELOW
Was able to remove the ccp0 from all urls when using SEO = TRUE.
In KHXC_Display.php on line 1003 you'll see :
$href_url .= $app . '-' . $ns . '/' . $ref . '.html';
I replaced mine like this as I sell I product called Linux:
$href_url .= 'linux' . '-' . $ns . '/' . $ref . '.html';
Now urls look like this
http://www.linuxcdshop.com/linux-catshow/bundle.html
http://www.linuxcdshop.com/linux-prodsh … ledvd.html
Just want to make other url's more unique.. If you know how, tell me..
Last edited by Perkster (12-03-2007 02:16:16)
Offline
UPDATE:
What I am talking about here is changing url's Now if this has been talked about please let me know and point me to exactly where it is mentioned in forum.
I went one further.
In KHXC_Display.php on line 1003 you'll see :
$href_url .= $app . '-' . $ns . '/' . $ref . '.html';
Ignore my above post, now it is:
$href_url .= $ns . '/' . $ref . '.html';
I then added a whole bunch of rewrite tules to my .htaccess file. Here is what it looks like. Now you may have more pages so you may have to tweak your .htaccess a little more. I am also doing this on a non production server and I dont care if I get 404 errors while testing
Here is my .htaccess file:
Options +FollowSymLinks
RewriteEngine on
# New Rules
RewriteRule ^catshow/(.*)\.html index.php?app=ccp0&ns=catshow&ref=$1 [L,PT]
RewriteRule ^prodshow/(.*)\.html index.php?app=ccp0&ns=prodshow&ref=$1 [L,PT]
RewriteRule ^display/(.*)\.html index.php?app=ccp0&ns=display&ref=$1 [L,PT]
RewriteRule ^viewcart/(.*)\.html index.php?app=ccp0&ns=viewcart&ref=$1 [L,PT]
RewriteRule ^contact/(.*)\.html index.php?app=ccp0&ns=contact&ref=$1 [L,PT]
RewriteRule ^prodidx/(.*)\.html index.php?app=ccp0&ns=prodidx&ref=$1 [L,PT]
RewriteRule ^prodall/(.*)\.html index.php?app=ccp0&ns=prodall&ref=$1 [L,PT]
RewriteRule ^prodsearch/(.*)\.html index.php?app=ccp0&ns=prodsearch&ref=$1 [L,PT]
RewriteRule ^prodbest/(.*)\.html index.php?app=ccp0&ns=prodbest&ref=$1 [L,PT]
RewriteRule ^prodnew/(.*)\.html index.php?app=ccp0&ns=prodnew&ref=$1 [L,PT]
RewriteRule ^prodspec/(.*)\.html index.php?app=ccp0&ns=prodspec&ref=$1 [L,PT]
RewriteRule ^deletecart/(.*)\.html index.php?app=ccp0&ns=deletecart&ref=$1 [L,PT]
RewriteRule ^dynform/(.*)\.html index.php?app=ccp0&ns=dynform&ref=$1 [L,PT]
RewriteRule ^splash/(.*)\.html index.php?app=ccp0&ns=splash&ref=$1 [L,PT]
# Old Rule
# RewriteRule ^(.*)-(.*)/(.*)\.html index.php?app=$1&ns=$2&ref=$3 [L,PT]
Links now like:
http://www.linuxcdshop.com/display/splash.html
http://www.linuxcdshop.com/prodshow/gos101.html
Now the above seems to work so far for me but I havent finished all testing. Try at your own risk... Always backup or comment out old code.
Now all I want to do it change the catshow and prodshow references. If anyone knows that please let me know..
Last edited by Perkster (12-03-2007 02:23:10)
Offline
UPDATE.
Found Nick's post from July:
https://forum.kryptronic.com/viewtopic.php?id=17589
This helped alot.
My code added In KHXC_Display.php :
$href_url = preg_replace('/catshow/','distro',$href_url);
$href_url = preg_replace('/prodshow/','linux',$href_url);
My new .htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^distro/(.*)\.html index.php?app=ccp0&ns=catshow&ref=$1 [L,PT]
RewriteRule ^linux/(.*)\.html index.php?app=ccp0&ns=prodshow&ref=$1 [L,PT]
RewriteRule ^display/(.*)\.html index.php?app=ccp0&ns=display&ref=$1 [L,PT]
RewriteRule ^viewcart/(.*)\.html index.php?app=ccp0&ns=viewcart&ref=$1 [L,PT]
RewriteRule ^contact/(.*)\.html index.php?app=ccp0&ns=contact&ref=$1 [L,PT]
RewriteRule ^prodidx/(.*)\.html index.php?app=ccp0&ns=prodidx&ref=$1 [L,PT]
RewriteRule ^prodall/(.*)\.html index.php?app=ccp0&ns=prodall&ref=$1 [L,PT]
RewriteRule ^prodsearch/(.*)\.html index.php?app=ccp0&ns=prodsearch&ref=$1 [L,PT]
RewriteRule ^prodbest/(.*)\.html index.php?app=ccp0&ns=prodbest&ref=$1 [L,PT]
RewriteRule ^prodnew/(.*)\.html index.php?app=ccp0&ns=prodnew&ref=$1 [L,PT]
RewriteRule ^prodspec/(.*)\.html index.php?app=ccp0&ns=prodspec&ref=$1 [L,PT]
RewriteRule ^deletecart/(.*)\.html index.php?app=ccp0&ns=deletecart&ref=$1 [L,PT]
RewriteRule ^dynform/(.*)\.html index.php?app=ccp0&ns=dynform&ref=$1 [L,PT]
RewriteRule ^splash/(.*)\.html index.php?app=ccp0&ns=splash&ref=$1 [L,PT]
# RewriteRule ^(.*)-(.*)/(.*)\.html index.php?app=$1&ns=$2&ref=$3 [L,PT]
Hope this helps.
Offline
Is it possible to remove that directory completely?
So url would be http://www.linuxcdshop.com/gos101.html
Last edited by theblade24 (01-18-2008 17:43:40)
Offline
theblade24 wrote:
Is it possible to remove that directory completely?
So url would be http://www.linuxcdshop.com/gos101.html
You would have to have a rewrite rule for every single product in your store if you did that. The directory in the SEO URLs is the only trigger to the rules to get the real URL built correctly.
Offline
Call me crazy but I was working on a site today and thought to myself, self, why can't we have very specific URLs without any extra subdirectory names in the URLs? What I ended up with was a very specific set of URLs that all look like HTML pages directly in the root of the site. It took changes to KHXC_Display.php and .htaccess but I think it ended up looking a lot cleaner and, in the end, will help SEO.
In KHXC_Display inserted AFTER line 997 which reads:
$href_url .= $app . '-' . $ns . '/' . $ref . '.html';
The following was added:
$href_url = preg_replace('/' . $app . '-catshow/','Category',$href_url); $href_url = preg_replace('/' . $app . '-prodshow/','Product',$href_url); $href_url = preg_replace('/' . $app . '-display/','Reference',$href_url); $href_url = preg_replace('/' . $app . '-prodspec\/KHXCseo.html/','Store_Specials.html',$href_url); $href_url = preg_replace('/' . $app . '-prodnew\/KHXCseo.html/','New_Products.html',$href_url); $href_url = preg_replace('/' . $app . '-prodall\/KHXCseo.html/','View_All_Products.html',$href_url); $href_url = preg_replace('/' . $app . '-prodidx\/KHXCseo.html/','Product_Index.html',$href_url); $href_url = preg_replace('/' . $app . '-prodbest\/KHXCseo.html/','Best_Sellers.html',$href_url); $href_url = preg_replace('/' . $app . '-prodsearch\/KHXCseo.html/','Advanced_Product_Search.html',$href_url); $href_url = preg_replace('/' . $app . '-contact\/KHXCseo.html/','Contact_Us.html',$href_url); $href_url = preg_replace('/' . $app . '-viewcart\/KHXCseo.html/','View_Shopping_Cart.html',$href_url);
In the .htaccess file BEFORE the existing rewrite rule used to facilitate SEO which reads:
RewriteRule ^(.*)-(.*)/(.*)\.html index.php?app=$1&ns=$2&ref=$3 [L,PT]
The following was added:
RewriteRule ^Category/(.*)\.html index.php?app=ccp0&ns=catshow&ref=$1 [L,PT] RewriteRule ^Product/(.*)\.html index.php?app=ccp0&ns=prodshow&ref=$1 [L,PT] RewriteRule ^Reference/(.*)\.html index.php?app=ccp0&ns=display&ref=$1 [L,PT] RewriteRule ^Store_Specials.html index.php?app=ccp0&ns=prodspec [L,PT] RewriteRule ^New_Products.html index.php?app=ccp0&ns=prodnew [L,PT] RewriteRule ^View_All_Products.html index.php?app=ccp0&ns=prodall [L,PT] RewriteRule ^Product_Index.html index.php?app=ccp0&ns=prodidx [L,PT] RewriteRule ^Best_Sellers.html index.php?app=ccp0&ns=prodbest [L,PT] RewriteRule ^Advanced_Product_Search.html index.php?app=ccp0&ns=prodsearch [L,PT] RewriteRule ^Contact_Us.html index.php?app=ccp0&ns=contact [L,PT] RewriteRule ^View_Shopping_Cart.html index.php?app=ccp0&ns=viewcart [L,PT]
The complete .htaccess with the new rules added looks like this:
Options +FollowSymLinks RewriteEngine On RewriteRule ^Category/(.*)\.html index.php?app=ccp0&ns=catshow&ref=$1 [L,PT] RewriteRule ^Product/(.*)\.html index.php?app=ccp0&ns=prodshow&ref=$1 [L,PT] RewriteRule ^Reference/(.*)\.html index.php?app=ccp0&ns=display&ref=$1 [L,PT] RewriteRule ^Store_Specials.html index.php?app=ccp0&ns=prodspec [L,PT] RewriteRule ^New_Products.html index.php?app=ccp0&ns=prodnew [L,PT] RewriteRule ^View_All_Products.html index.php?app=ccp0&ns=prodall [L,PT] RewriteRule ^Product_Index.html index.php?app=ccp0&ns=prodidx [L,PT] RewriteRule ^Best_Sellers.html index.php?app=ccp0&ns=prodbest [L,PT] RewriteRule ^Advanced_Product_Search.html index.php?app=ccp0&ns=prodsearch [L,PT] RewriteRule ^Contact_Us.html index.php?app=ccp0&ns=contact [L,PT] RewriteRule ^View_Shopping_Cart.html index.php?app=ccp0&ns=viewcart [L,PT] RewriteRule ^(.*)-(.*)/(.*)\.html index.php?app=$1&ns=$2&ref=$3 [L,PT]
Obviously the use of Category for categories and Product for products as well as any of the other names is easily changed by updating both KHXC_Display and the corresponding .htaccess rules. What all this is does is create simple HTML looking URLs. For example, specials now looks like this
http://www.yourdomain.com/Store_Specials.html
New products looks like
http://www.yourdomain.com/New_Products.html
etc etc ... hopefully somebody will find this useful
Offline
{private}/core/KHXC_Display
Offline
Dave, I'm currently setting up my cart under <mydomain>.com/khxc/. The root of my site is actually live and taking orders. Can I do the following:
incorporate all changes in your post above with /khxc/ in front of any url you referenced and make the .htaccess file changes to the .htaccess file under /khxc/?
Basically, I want to turn on SEO while I'm still setting up the site, without affecting my working site. When ready to go live, do I just move the .htaccess file to the root?
Your thoughts?
James...
Offline
wyattea wrote:
incorporate all changes in your post above with /khxc/ in front of any url you referenced and make the .htaccess file changes to the .htaccess file under /khxc/?
If you have basic SEO working already then yes, you should be able to incorporate the changes adding the additional directory path to the URL.
wyattea wrote:
When ready to go live, do I just move the .htaccess file to the root?
Are you going to move CCP to the root also? If you aren't how do you plan to get people down into the khxc directory?
Offline
I don't have SEO setup right now. Never turned it on since I'm not live, didn't bother yet. I have the site under .com/khxc/ - so I'll have to just move all files to the root? I thought I could have it under the /khxc/ subdir and use .htaccess in the root to point to that subdir, but use rewrite rules to hide /khxc/ from being seen. Guess not?
James...
Offline
I'd turn it on with the basics to make sure it's working before you dive in any further. I believe you could leave it in khxc and redirect but I've seen folks here in the fora say that doing that isn't good for SEO (I don't personally know if it is or isn't). I'm fairly certain that you'd still end up with the khxc in the path though.
Moving it to the root should be as simple as moving index.php and the other 4 public files to the root and running the installer to update the paths and cookie settings.
Offline
Ok, got it working...what about this url: .../ccp0-viewcart/KHXCseo.php, can it be edited or did you omit for a reason?
Can we remove the /Category/ and /Product/ directories? I thought I read that somewhere but I could be wrong?
Thanks!
James...
Last edited by wyattea (03-13-2008 06:56:06)
Offline
.htaccess has to be in the root of the site not in khxc (sorry I didn't catch that and mention it in the previous post).
Offline
well, I don't want it in the root, since I'm not running the site from the root right now (my live site is there). So i put it in /khxc/ and it's working fine. Anything wrong with that?
James...
Offline
with 5.1, I have <domain>/c-Valentine-Gift-Baskets-vdaygb.php for categories and <domain>/i-Friendship-Bears-Fruit-FB461.php for products. No categories, just c- and i- for categories and items. Can this be done with 6.0?
James...
Offline
wyattea wrote:
well, I don't want it in the root, since I'm not running the site from the root right now (my live site is there). So i put it in /khxc/ and it's working fine. Anything wrong with that?
It won't work if it's in a lower level directory.
Offline
wyattea wrote:
with 5.1, I have <domain>/c-Valentine-Gift-Baskets-vdaygb.php for categories and <domain>/i-Friendship-Bears-Fruit-FB461.php for products. No categories, just c- and i- for categories and items. Can this be done with 6.0?
That's what my post 8 in this thread was all about James. But you'll want your store running in the root of the site to make your life easier (could probably get away with having it in khxc but I haven't tried that).
Offline
Dave, it's NOT live yet, I don't want people going to the root and seeing the site. It's it /khxc/ while I work on it. I'll move the files to the root when it's ready to go live and re-run the installer to change the dirs.
I did exactly what you posted in #8. Your code creates the /Reference/, /Category/ and /Product/ directories. It only removes dirs for the other pages (Specials, Best Sellers, etc.). How do I get rid of /Reference/, /Category/ and /Product/ completely?
Offline
I looked at the rewrite rule from 5.1, and it uses this:
RewriteRule p-(.*)\.php index.php?app=ccp0&ns=prodshow&ref=$1 [L,PT]
But changing it to that didn't work - you have a ^ in front of the rule, I don't know what that does.
Any thoughts?
James...
Offline
wyattea wrote:
Dave, it's NOT live yet, I don't want people going to the root and seeing the site.
Having .htaccess in the root won't make people going to the site see the store unless you specifically add an additional rule to send them there.
wyattea wrote:
I did exactly what you posted in #8. Your code creates the /Reference/, /Category/ and /Product/ directories. It only removes dirs for the other pages (Specials, Best Sellers, etc.). How do I get rid of /Reference/, /Category/ and /Product/ completely?
You can't really without creating a rule for every single product, category and HTML page. There has to be a "break point" in the URL to allow the rules to work. The rules work because what type of page is being requested can be determined by the URL. Simply using a x- won't allow that detection to work.
Offline