Zen Cart Logo
Forums / All Other Contributions/Addons / Ceon URI Mapping v4.x

Ceon URI Mapping v4.x

Views: 451,981

Results 2,221 to 2,240 of 2,454
6 Mar 2018, 4:12 PM
#2221
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Ceon URI Mapping v4.x

simon1066:

Not sure what pointers you need but I have my local dev copies of ZC running on a windows pc (uniformserver), this is the way I've done it and apologies in advance if I'm teaching you to suck eggs:

by editing the windows etc/hosts file I access the dev site just by using example.com - no localhost to worry about and this means my URI's are the same as my live site. Of course this means I can't access the live site on this PC without changing the hosts file, which is fine as I have another PC for live site access.

my CEON htaccess (root) content is the same as yours.

my includes/configure.php is

define('HTTP_SERVER', 'https://example.com');
define('HTTPS_SERVER', 'https://example.com');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_FS_CATALOG', 'C:/server/UniserverZ/www/example.com/');

> 
> 
> Hope this helps.
If I had a single test-site, that would work; unfortunately, I've got a bunch of them.
6 Mar 2018, 4:29 PM
#2222
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

lat9:

If I had a single test-site, that would work; unfortunately, I've got a bunch of them.

The other that I have seen to work is to modify the HTTP_SERVER to include the sub-directory (to support transitioning the rewrites from local host to live) and then regarding the .htaccess, since the destination site will not have the store in the same sub-directory, an .htaccess file could be written now that when transferred would still apply to the live site.

So in light of not providing some internal "server/host name" would suggest:

define('HTTP_SERVER', 'http://localhost/store_name');
define('HTTPS_SERVER', 'https://localhost/store_name');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

and then in the .htaccess (located in the store_name sub-folder) after RewriteEngine on:

RewriteEngine on
RewriteCond %{ENV:URI} ^$
RewriteRule ^(.*)$ - [ENV=URI:$1]  

RewriteCond %{ENV:BASE} ^$ 
RewriteCond %{ENV:URI}::%{REQUEST_URI} ^(.*)::(.*?)\1$ 
RewriteRule ^ - [ENV=BASE:%2]

# All of the RewriteCond's from Ceon URI rewriter with the below modified RewriteRule
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
# ETC....
RewriteRule ^(.*)$ %{ENV:BASE}index.php [L,QSA]

This should allow and support that the URIs generated in the database will be based off of the HTTP_SERVER/HTTPS_SERVER content (happens to include a sub-folder) and that the htaccess will redirect to the sub-folder in which it currently resides.

Credit for the additional content or direction of the .htaccess file modification goes to at least Jon Lin on stackoverflow.

6 Mar 2018, 4:42 PM
#2223
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

although:

%{ENV:BASE}

May need to be added to the right side of each of the RewriteCond statements since they specifically identify a folder to exclude rather than testing the filesystem to identify that the provided link is to an existing file or not.

6 Mar 2018, 6:27 PM
#2224
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Ceon URI Mapping v4.x

Thanks, @mc12345678; I'll give that a try and report back.

6 Mar 2018, 9:05 PM
#2225
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Ceon URI Mapping v4.x

lat9:

Thanks, @mc12345678; I'll give that a try and report back.
... and reporting back, I am.

With a combination of @mc12345678's comments (prodding my memory), what I did was two-fold:

Updated the configure.php's to contain:
HTTP_SERVER = http://localhost/store_name
HTTPS_SERVER = https://localhost/store_name
DIR_WS_CATALOG = /

The change to the .htaccess file was much simpler, I simply added

RewriteBase /store_name/

just after the RewriteEngine On and before the start of the Ceon URI rules. I'm doing a happy-dance; thanks again, @mc12345678!:clap:

6 Mar 2018, 9:26 PM
#2226
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

Welcome and that was going to be my suggestion if the local and destination site were to be in the same sub-directory so that it would be consistent (no "update" comment/notes needed)... :) but glad that that issue is addressed, don't party all night! :)

6 Mar 2018, 9:42 PM
#2227
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Ceon URI Mapping v4.x

Unfortunately, that was necessary but not sufficient. The redirects are now being pushed to /localhost/store_name/uri but something's still not right.:(

I can get the category links to work, but not the product-specific ones. I'll report back (yet again) when I've figured out what the heck is going on.

6 Mar 2018, 9:58 PM
#2228
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

lat9:

Unfortunately, that was necessary but not sufficient. The redirects are now being pushed to /localhost/store_name/uri but something's still not right.:(

I can get the category links to work, but not the product-specific ones. I'll report back (yet again) when I've figured out what the heck is going on.
Assuming that before clicking on a link to a product that looking at the link generated/to be followed? Or just seeing that after clicking the desired result is not obtained?

7 Mar 2018, 5:48 AM
#2229
gdtw avatar

gdtw

New Zenner

Join Date:
Mar 2018
Location:
atlanta
Posts:
10
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

i have the latest zen cart and no other modules.

i copied the .htaccess from the output of the installation check, and got

"The requested URL /furniture/folding-butterfly-sakura-bamboo-handheld-vintage-fan-for-beach-s was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

same results if i added the slash, i.e. RewriteRule .* /index.php [QSA,L]

the URL comes from clicking the item on my home page https://www.bamboyant.life/

i got most of the files from torvista/CEON-URI-Mapping https://github.com/torvista/CEON-URI-Mapping (for php 7), except for the few files from the latest ceon uri mapping.

7 Mar 2018, 9:19 AM
#2230
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: Ceon URI Mapping v4.x

Any pointers for running the Ceon URI Mapping on a localhost installation?

Yes. As a virtual host. As recommended to me by Conor RIP. I have been using this setup for years.

Set up the site to use an url such as
www.mysite.local

NOT 127.0.0.1/whatever nor localhost/whatever.

The use of those two local domains will cause you issues with sll certificates down the road as browsers tighten up access to those addresses.

Here are the steps required.
Make sure a step works before proceeding further or it's a world of pain.

  1. This requires the entry in the hosts file:
    127.0.0.1 www.mysite.local
    Check this works with a static site.

  2. Add the corresponding code in the apache config \apache\conf\extra\httpd-vhosts.conf

This is mine with names changed to protect the innocent.

<VirtualHost *:80>
ServerName www.mysite.local
ServerAlias www.mysite.local
DocumentRoot "D:/Documents/PATH TO SITE/public_html"
ErrorLog "logs/vhosts-error.log"
<Directory "D:/Documents/PATH TO SITE/public_html">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:443>
ServerName www.mysite.local
ServerAlias www.mysite.local
SSLEngine on
SSLCertificateFile conf/ssl.crt/server.crt
SSLCertificateKeyFile conf/ssl.key/server.key
DocumentRoot "D:/Documents/PATH TO SITE/public_html"
ErrorLog "logs/vhosts-error.log"
<Directory "D:/Documents/PATH TO SITE/public_html">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

#the paths to the certificate may not be as your server...Google is your friend.

Check this works for both http and https on a static site.

  1. Local Shop
    Change the configs to suit. Check it all works without URI Mapping enabled.

I remember a couple of occasions when it just would not work. Eventually I did a new install using the virtual host url https://www.mysite.local just to get examples of working configs.

  1. Set up the URI mapping as usual.
7 Mar 2018, 12:56 PM
#2231
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Ceon URI Mapping v4.x

mc12345678:

Assuming that before clicking on a link to a product that looking at the link generated/to be followed? Or just seeing that after clicking the desired result is not obtained?
Yep, the link visually looked correct, e.g. localhost/store_name/the_page_link. Here's a dump of the $_SERVER variables on entry:

  'SERVER_NAME' => 'localhost',
  'SERVER_ADDR' => '::1',
  'SERVER_PORT' => '80',
  'REMOTE_ADDR' => '::1',
  'DOCUMENT_ROOT' => 'C:/xampp/htdocs',
  'REQUEST_SCHEME' => 'http',
  'CONTEXT_PREFIX' => '',
  'CONTEXT_DOCUMENT_ROOT' => 'C:/xampp/htdocs',
  'SERVER_ADMIN' => 'postmaster@localhost',
  'SCRIPT_FILENAME' => 'C:/xampp/htdocs/store_name/index.php',
  'REMOTE_PORT' => '56161',
  'REDIRECT_URL' => '/store_name/the-page-link',
  'GATEWAY_INTERFACE' => 'CGI/1.1',
  'SERVER_PROTOCOL' => 'HTTP/1.1',
  'REQUEST_METHOD' => 'GET',
  'QUERY_STRING' => '',
  'REQUEST_URI' => '/store_name/the_page_link',
  'SCRIPT_NAME' => '/store_name/index.php',
  'PHP_SELF' => '/store_name/index.php',

What's happening is that the_page_link, when clicked always returns to the main-page (i.e. without parameters, so no category or product listings).

7 Mar 2018, 1:25 PM
#2232
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Ceon URI Mapping v4.x

torvista:

Yes. As a virtual host. As recommended to me by Conor RIP. I have been using this setup for years.

Set up the site to use an url such as
www.mysite.local

NOT 127.0.0.1/whatever nor localhost/whatever.

The use of those two local domains will cause you issues with sll certificates down the road as browsers tighten up access to those addresses.

Here are the steps required.
Make sure a step works before proceeding further or it's a world of pain.

  1. This requires the entry in the hosts file:
    127.0.0.1 www.mysite.local
    Check this works with a static site.

  2. Add the corresponding code in the apache config \apache\conf\extra\httpd-vhosts.conf

This is mine with names changed to protect the innocent.

<VirtualHost *:80>
ServerName www.mysite.local
ServerAlias www.mysite.local
DocumentRoot "D:/Documents/PATH TO SITE/public_html"
ErrorLog "logs/vhosts-error.log"
<Directory "D:/Documents/PATH TO SITE/public_html">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:443>
ServerName www.mysite.local
ServerAlias www.mysite.local
SSLEngine on
SSLCertificateFile conf/ssl.crt/server.crt
SSLCertificateKeyFile conf/ssl.key/server.key
DocumentRoot "D:/Documents/PATH TO SITE/public_html"
ErrorLog "logs/vhosts-error.log"
<Directory "D:/Documents/PATH TO SITE/public_html">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

#the paths to the certificate may not be as your server...Google is your friend.

Check this works for both http and https on a static site.

  1. Local Shop
    Change the configs to suit. Check it all works without URI Mapping enabled.

I remember a couple of occasions when it just would not work. Eventually I did a new install using the virtual host url https://www.mysite.local just to get examples of working configs.

  1. Set up the URI mapping as usual.
    I'll give that a try, Steve. My hesitancy is that I've got a bunch of test sites locally and don't want to get them (and myself) confused.
8 Mar 2018, 7:10 AM
#2233
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I usually create a virtual host for every test / backup site I'm working on.
I don't need no fancy Apache configuration, so it just a matter of copy / paste and add those entries in the hosts file.
I've tried recently to use the vagrant way, using the puphpet config, because it makes more sense when it comes to work in different places and machines, but, all I did was waste a couple of days, and failed miserably! Something related with vbguest plugin and the SMB share. But, on a Mac or Linux perhaps it's easier, and brings a lot of advantages.

8 Mar 2018, 2:54 PM
#2234
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Ceon URI Mapping v4.x

lat9:

I'll give that a try, Steve. My hesitancy is that I've got a bunch of test sites locally and don't want to get them (and myself) confused.
Woo-hoo! Thanks a bunch, Steve.

8 Mar 2018, 10:05 PM
#2235
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: Ceon URI Mapping v4.x

Woo-hoo! Thanks a bunch, Steve.
I take it that worked then?!

A further plus of the virtual host approach is taking it to the next step of allowing outside access to your local dev Xampp install via a dynamic dns.
Obviously it goes without saying about the security risk and the steps you need to take to mitigate this, and only do it when you need to and not all the time.

But why do such a thing?
Well for mobile testing so you don't have to root the phone to modify the hosts file, and you can also call anyone you like and ask them to check it out and you can fiddle with it there and then, locally.
And also you can use a browser testing site to do mass tests.
And if you are testing a connector with some other application that needs real internet access.

8 Mar 2018, 10:36 PM
#2236
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Ceon URI Mapping v4.x

torvista:

I take it that worked then?!

A further plus of the virtual host approach is taking it to the next step of allowing outside access to your local dev Xampp install via a dynamic dns.
Obviously it goes without saying about the security risk and the steps you need to take to mitigate this, and only do it when you need to and not all the time.

But why do such a thing?
Well for mobile testing so you don't have to root the phone to modify the hosts file, and you can also call anyone you like and ask them to check it out and you can fiddle with it there and then, locally.
And also you can use a browser testing site to do mass tests.
And if you are testing a connector with some other application that needs real internet access.
You're correct, I'm up and running (sorry for being obtuse). The test site in question *really *needed to have the Ceon URI Mappings work, since the hosted site doesn't have space to contain a duplicate/test site.

19 Mar 2018, 4:24 PM
#2237
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Sorry if this was discussed already but the search did not return anything.

What is the best solution for having multilingual url's appear as a subdirectory (for ex yourstore.com/fr/abc-item) in conjunctuion with CEON mod?

24 Apr 2018, 8:09 PM
#2238
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Bring Up My Post

ShopVille:

Sorry if this was discussed already but the search did not return anything.

What is the best solution for having multilingual url's appear as a subdirectory (for ex yourstore.com/fr/abc-item) in conjunctuion with CEON mod?

24 Apr 2018, 8:58 PM
#2239
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: Ceon URI Mapping v4.x

*What is the best solution for having multilingual url's appear as a subdirectory (for ex yourstore.com/fr/abc-item) *
I have no idea.

11 May 2018, 3:17 AM
#2240
erica62 avatar

erica62

New Zenner

Join Date:
Feb 2014
Posts:
42
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Hi,

I have a fresh install of 1.5.5f and PHP7. I have a database that was working fine with 1.5.1, and currently I can get everything to jive, accept when I go to Catalog, then Category/Products, select a product, it shows the top of the page down to the populated Product Name field, but fails to finish displaying the rest of the page, showing "TEXT_PRODUCTS_MERKMALE" and that's it.

Has anyone seen this before? It must be in one of the ceon pages but I can't find it. All other pages in /admin, plus the actual site are groovy, it's just page product.php so far.

Thanks,

Eric