Re: Ceon URI Mapping (SEO)
Hi,
Quote:
Originally Posted by
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! :)
Quote:
Originally Posted by
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
Code:
RewriteRule (.*) zc1/index.php?%{QUERY_STRING} [L]
to
Code:
RewriteRule (.*) index.php?%{QUERY_STRING} [L]
A guess would be that your server is looking for zc1/zc1/index.php as the .htaccess file is in the zc1 directory and refers to another zc1 subdirectory.
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
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)
Quote:
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."
2. With .htaccess file located in the / directory
Quote:
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
Quote:
Originally Posted by
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
Re: Ceon URI Mapping (SEO)
Hi,
About to leave the office for the day..
Have you tried the second option you listed with
Code:
RewriteRule (.*) index.php?%{QUERY_STRING} [L]
Quote:
Originally Posted by
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
Re: Ceon URI Mapping (SEO)
Quote:
Have you tried the second option you listed with
Code:
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
Re: Ceon URI Mapping (SEO)
Hi,
Quote:
Originally Posted by
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
Category link on Product Page is bad
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
Re: Category link on Product Page is bad
Hi,
Quote:
Originally Posted by
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
Re: Category link on Product Page is bad
Hi,
Quote:
Originally Posted by
jbittner
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:
PHP Code:
// This is a product related page
$_GET['products_id'] = $associated_db_id;
Add the following code:
PHP Code:
// 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 Code:
// 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
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:
Re: Ceon URI Mapping (SEO)
Hi Conor, Thanks for your help.
Quote:
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
Code:
LoadModule rewrite_module modules/mod_rewrite.so
and and restarted Apache.
(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
Code:
<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
Code:
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.