Zen Cart Logo
Forums / All Other Contributions/Addons / Ceon URI Mapping (SEO)

Ceon URI Mapping (SEO)

Locked

Views: 472,128

Results 421 to 440 of 2,913
This thread is locked. New replies are disabled.
4 Aug 2009, 1:24 PM
#421
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Ceon URI Mapping (SEO)

Hi,

remoteone:

The task was made easier by using WinMerge, but one still needs to carefully compare each file. It kind of reminded me of the old osCommerce that I abandoned long ago. Having said that, its good you separated out the Updated Core Files from the New.

There was no choice but to write it the way I did.. you can understand why I don't want to make any more core modifications, things would become very unwieldy then and it takes enough hours each week to support this module! :)

remoteone:

Despite your very clear instruction the module won't work. All seems of in the Admin side. But if a page has a URI generated, the store returns the 404 error: Page not found on this server error.

You have come up with your own custom RewriteRule. I'm afraid I'm not an expert on this.

You should either move the .htaccess file into the root of your store and use the example rule provided with the module, or you should try changing

RewriteRule (.*) zc1/index.php?%{QUERY_STRING} [L]                      
```to

RewriteRule (.*) index.php?%{QUERY_STRING} [L]


If that doesn't work, try the example rule shown in the instructions for *Example rule for stores installed in a folder other than the root of the site, with the admin named “admin”*, changing "shop" to "zc1".

Please note that the directory name should be your FINAL store's directory name as otherwise all your auto-generated URIs will have /zc1 at the start of them. I.e., you should test your store in the exact same subdirectory name as your final store (hence I recommend "shop" or "store" instead of "zc1").

All the best...

Conor
[ceon](http://dev.ceon.net)
4 Aug 2009, 2:45 PM
#422
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

That was some pretty fast typing there Conor. Thanks for the quick response.
OK, as per your examples:

1.With my .htaccess file located in the /zc1 directory (where index.php is located)

RewriteEngine On

ONLY rewrite URIs beginning with /zc1/

RewriteCond %{REQUEST_URI} ^/zc1/.* [NC]

Don't rewrite any URIs ending with a file extension (ending with .[xxxx])

RewriteCond %{REQUEST_URI} !.[a-zA-Z]{2,4}$

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/zc1/admin.* [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/zc1/editors.* [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule (.*) index.php?%{QUERY_STRING} [L]
Product URI generated example : /zc1/sony-ps3-ir-control/ps3ir-1000
Get "The requested URL /zc1/sony-ps3-ir-control/ps3ir-1000 was not found on this server."

  1. With .htaccess file located in the / directory

RewriteEngine On

ONLY rewrite URIs beginning with /zc1/

RewriteCond %{REQUEST_URI} ^/zc1/.* [NC]

Don't rewrite any URIs ending with a file extension (ending with .[xxxx])

RewriteCond %{REQUEST_URI} !.[a-zA-Z]{2,4}$

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/zc1/admin.* [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/zc1/editors.* [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule (.*) zc1/index.php?%{QUERY_STRING} [L]
Product URI generated example : /zc1/sony-ps3-ir-control
Get "The requested URL /zc1/sony-ps3-ir-control/ps3ir-1000 was not found on this server."

Ive also tried many many many other less logical combinations. Alas none worked.

I restarted Apache and cleared the cache each test

conor:

Please note that the directory name should be your FINAL store's directory name as otherwise all your auto-generated URIs will have /zc1 at the start of them. I.e., you should test your store in the exact same subdirectory name as your final store (hence I recommend "shop" or "store" instead of "zc1").
Ive used "zc1" instead of "store" etc for a reason that now escapes me.
My Live store http://www.remoteone.com.au has the same name. Having the Test store a different folder to the Live store would indeed be more un-necessary trouble.

All the generated URIs have /zc1 at the start of them. would this normally be the case (ie "/store/generated_url_name") or should they normally generate as just "/generated_url_name"

Thanks

4 Aug 2009, 3:24 PM
#423
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

About to leave the office for the day..

Have you tried the second option you listed with

RewriteRule (.*) index.php?%{QUERY_STRING} [L]

remoteone:

All the generated URIs have /zc1 at the start of them. would this normally be the case (ie "/store/generated_url_name") or should they normally generate as just "/generated_url_name"

No, they'll generate with the store's catalog prefix: /store/generated_url_name (in your case /zc1/generated_url_name.

Of course, you can just change them manually in the admin.

Hope that helps. Have a good evening!

All the best...

Conor
ceon

4 Aug 2009, 3:39 PM
#424
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Have you tried the second option you listed with

RewriteRule (.*) index.php?%{QUERY_STRING} [L]


Yep, Ive been trying for hours. Double checked it, Still no worky w that combo.

Have a good day!

Cheers
4 Aug 2009, 4:41 PM
#425
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

remoteone:

Yep, Ive been trying for hours. Double checked it, Still no worky w that combo.

The only other thing it can be is that your test site doesn't use .htaccess files.

I think you have overrides disabled.

Which means you'll either have to enable them and restart Apache or add the necessary rule in a VirtualHost directory and restart Apache.

All the best...

Conor
ceon

4 Aug 2009, 7:14 PM
#426
jbittner avatar

jbittner

New Zenner

Join Date:
Jul 2009
Posts:
4
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Conor said: > Hmm, that does look like a bug.

Does this bug exist on every website using the SEO plugin
or does it just affect people using 1.38a? Do you have any
idea when this bug might be fixed?


I am using the SEO for zen cart.
When it auto adds a category it works great.
It also auto adds a product fine.
Everything works except I find one error.

I select a category, then select a product
and it goes to the product page. On the
product page it displays an image in the
upper left side of the product area.
Above that image is a link to the category.
The category link is wrong. It displays
the category link as:

http://mysite.com/index.php?main_page=index&cPath=

It does this only when SEO is applied
to a product and the product page is displayed.
This link is correct if the product is
not using an SEO link.

Do you have a fix for this?

I'm using Zen Cart 1.3.8a

4 Aug 2009, 7:57 PM
#427
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

jbittner:

Does this bug exist on every website using the SEO plugin
or does it just affect people using 1.38a? Do you have any
idea when this bug might be fixed?

You're welcome to submit a patch yourself. Of course I'll try to get the time to fix it myself but time is something I don't have a lot of at the minute.

All the best...

Conor
ceon

4 Aug 2009, 8:22 PM
#428
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

jbittner:

On the product page it displays an image in the upper left side of the product area.
Above that image is a link to the category. The category link is wrong. It displays the category link as:

http://mysite.com/index.php?main_page=index&cPath=

I've taken a look at this and found a bug in Zen Cart's init_category_path.php file which causes this problem.

The product info display page uses two files to build the category listings, tpl_modules_category_icon_display.php and tpl_products_next_previous.php.

In tpl_modules_category_icon_display.php the category is being linked to using the query string parameter $_GET['cPath'], whereas in tpl_products_next_previous.php the same category is being linked to using the value of the $cPath variable as set up in init_category_path.php.

Since the product page for URI mapped pages only has a $cPath variable initialised by the init_category_path script but no $_GET['cPath'] variable initialised, the link to the category page gets broken.

Obviously Zen Cart wasn't built to not have the $_GET['cPath'] parameter on the product page but it's obviously not good practice to use two variable names for the same parameter and only initialise one, so I'd say this is a Zen Cart bug that the URI Mapping module has to get around, rather than the reverse.

Not that anyone probably cares, so here's the solution...

Edit includes/init_includes/init_ceon_uri_mapping.php

After lines 360-361, which are the following:

                                // This is a product related page
                                $_GET['products_id'] = $associated_db_id;
```Add the following code:

```php
                                // Rebuild the cPath variable for this page if it doesn't exist
                                if (!isset($_GET['cPath'])) {
                                    $_GET['cPath'] = zen_get_product_path($_GET['products_id']);
                                }
```(So the block becomes:)

```php
                                // This is a product related page
                                $_GET['products_id'] = $associated_db_id;
                                
                                // Rebuild the cPath variable for this page if it doesn't exist
                                if (!isset($_GET['cPath'])) {
                                    $_GET['cPath'] = zen_get_product_path($_GET['products_id']);
                                }
```As my previous post indicates I'm low on time at the minute so I won't be able to release an updated version of the module quite yet. Hopefully sometime next week (unless I can find time this week).

All the best...

Conor
[ceon](http://dev.ceon.net)
5 Aug 2009, 5:01 PM
#429
jbittner avatar

jbittner

New Zenner

Join Date:
Jul 2009
Posts:
4
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

WOW! Now that is a great fix! I am very pleased. Thank you for taking time to fix this. I really thought this was a very important fix. You have proved yourself on this. I would recommend this addon to others.

I am still very interested in URI Mappings Manager. I have previously registered my interest in it. I think my boss would be happy to pay a reasonable price to add its capability to our cart. I am anxious to know when that might be available.

T H A N K S ! ! !

:smile:

6 Aug 2009, 1:44 PM
#430
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Hi Conor, Thanks for your help.

The only other thing it can be is that your test site doesn't use .htaccess files.
Your right, my local test machine wasnt using .htaccess.
- Heres the fix here for anyone interested. -
Apache had "mod_rewrite" disabled (#LoadModule rewrite_module
modules/mod_rewrite.so) and overrides disabled ( AllowOverride None) in C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
Enabled both by changing to LoadModule rewrite_module modules/mod_rewrite.so and ```
AllowOverride All

(this site <http://corz.org/serv/tricks/htaccess.php> makes interesting reading)

I Tested .htaccess by placing a "index.html" file in "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test_htaccess\"
and a .htaccess file with ```
<Files *>
deny from all
</Files>  

The test file is now forbidden, showing that .htaccess is now working

It Works ! :clap:...the new URi page "http://localhost/zc1/sony-ps3-ir-control/ps3ir-1000" loads now with /htdocs/.htaccess file as

RewriteEngine On

# ONLY rewrite URIs beginning with /zc1/
RewriteCond %{REQUEST_URI} ^/zc1/.* [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxx])
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/zc1/admin.* [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/zc1/editors.* [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]
# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) zc1/index.php?%{QUERY_STRING} [L]

Lastly, should I apply the bug fix code you posted for jbittner ?

You've been a great help. Thank you for this mod.
Much appreciated.

6 Aug 2009, 1:55 PM
#431
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

remoteone:

You've been a great help. Thank you for this mod.
Much appreciated.

Glad I was able to identify the "problem"! :)

I'm also glad that you like the module!

remoteone:

Lastly, should I apply the bug fix code you posted for jbittner ?

If you display a category image on the product page (i.e. if Configuration > Product Info > Previous Next - Navigation Includes Category Position is **not **set to 0/"off"), then yes, you should. Otherwise you can just wait until I release a new version and install it (to save you all the copying and pasting!).

All the best...

Conor
ceon

6 Aug 2009, 1:59 PM
#432
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

jbittner:

WOW! Now that is a great fix! I am very pleased. Thank you for taking time to fix this. I really thought this was a very important fix. You have proved yourself on this. I would recommend this addon to others.

Glad I could help and glad you like the module! Thanks for the nice comments.

All the best...

Conor
ceon

6 Aug 2009, 2:56 PM
#433
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Conor,
After I pasted in the code into *includes/init_includes/init_ceon_uri_mapping.php *, lines 360-361. (My Previous Next - Navigation Includes Category Position =1)
All pages are completely blank.
Gone back to your original file. So I guess I'll wait for the bug fix before I go live w this mod.
Cheers

6 Aug 2009, 3:07 PM
#434
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

remoteone:

After I pasted in the code into *includes/init_includes/init_ceon_uri_mapping.php *, lines 360-361. (My Previous Next - Navigation Includes Category Position =1)
All pages are completely blank.

You messed up pasting the code in then!

Best to wait on a new version if you're not sure about PHP etc! :)

All the best...

Conor
ceon

6 Aug 2009, 3:40 PM
#435
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

conor:

You messed up pasting the code in then!

Best to wait on a new version if you're not sure about PHP etc! :)

Er .. is that a question or a statement? No mate, I didnt mess up the paste of the code. Please see attached image.

6 Aug 2009, 4:00 PM
#436
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

remoteone:

Er .. is that a question or a statement? No mate, I didnt mess up the paste of the code. Please see attached image.

You missed a closing bracket after the pasted code.. you shouldn't have selected it before pasting, but only the following two lines... :)

                                // This is a product related page
                                $_GET['products_id'] = $associated_db_id;  

All the best...

Conor
ceon

6 Aug 2009, 4:32 PM
#437
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Conor,
ok so it was a statement then! :blush:
damn those pesky closing brackets!
Sorry. it was about 1:30 am. brain nbg, must get sleep.

Cheers

6 Aug 2009, 8:10 PM
#438
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

remoteone:

Conor,
ok so it was a statement then! :blush:
damn those pesky closing brackets!
Sorry. it was about 1:30 am. brain nbg, must get sleep.

lol that's a good an excuse as any! :)

Glad you're sorted now!

All the best...

Conor
ceon

7 Aug 2009, 4:16 AM
#439
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Conor.
Its up and running on my live site. Fantastic.
Just have suggestion, (youve probly already thort of these)

  1. It would be cool if the Ceon URI status for each cat/product/or page showed up in the Action Column as it does for *metatags defined *etc.
    Admin could see which pages dont yet have the URI defined. And a quck editing box that comes up without the need to open the full product desc page. This would speed up URI management for we poor buggers forced to be running dial-up speeds.
  2. Maybe a button/checkbox on the Categories / Products / ez-pages admin page(s) allowing shops to auto-gen all products in one go. Good for shops w many products.
    Yep, I'm the ideas-man !
    Cheers.
7 Aug 2009, 5:22 PM
#440
steveyork136 avatar

steveyork136

New Zenner

Join Date:
Nov 2005
Posts:
84
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

can I disable this without access to the database.

my hosting company has said my site is taking up too much bandwidth and has locked the database they won't restore it with me "removing the script" causing the problem,

I think they are lying but I need to do something to get my site back online and I was going to disable CEON and tell them its done and get my site back online.

but they won't turn the database back on so disabling via the php files is my only option, only need to be temporary so I don't want to remove the full module.

thanks