Thanks for that @paul3648, I'd tried that a couple of years ago but had issues. I'll give it another shot.
Printable View
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:
and then in the .htaccess (located in the store_name sub-folder) after RewriteEngine on:Code:define('HTTP_SERVER', 'http://localhost/store_name');
define('HTTPS_SERVER', 'https://localhost/store_name');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
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.Code: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]
Credit for the additional content or direction of the .htaccess file modification goes to at least Jon Lin on stackoverflow.
although:
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.Code:%{ENV:BASE}
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:
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! :)
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.
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.